<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>jquery-1.8.1.js</title>
<meta name="Generator" content="Vim/7.3" />
<meta name="plugin-version" content="vim7.3_v6" />
<meta name="syntax" content="javascript" />
<meta name="settings" content="use_css,no_foldcolumn,use_xhtml,number_lines" />
<style type="text/css">

pre { font-family: monospace; color: #ffffff; background-color: #333333; }
a {color:#ff4500}
body { font-family: monospace; color: #ffffff; background-color: #333333; }
.lnr { color: #ffff00; }
.Error { color: #ffffff; background-color: #ff0000; }
.Todo { color: #ff4500; background-color: #eeee00; }
.Constant { color: #ffa0a0; }
.Statement { color: #f0e68c; font-weight: bold; }
.Special { color: #ffdead; }
.Type { color: #bdb76b; font-weight: bold; }
.Identifier { color: #98fb98; }
.Comment { color: #87ceeb; }

</style>
</head>
<body>
<pre>
<span class="lnr">    1 </span><span class="Comment">/*!</span>
<span class="lnr">    2 </span><span class="Comment"> * jQuery JavaScript Library v1.8.1</span>
<span class="lnr">    3 </span><span class="Comment"> * <a href="http://jquery.com/">http://jquery.com/</a></span>
<span class="lnr">    4 </span><span class="Comment"> *</span>
<span class="lnr">    5 </span><span class="Comment"> * Includes Sizzle.js</span>
<span class="lnr">    6 </span><span class="Comment"> * <a href="http://sizzlejs.com/">http://sizzlejs.com/</a></span>
<span class="lnr">    7 </span><span class="Comment"> *</span>
<span class="lnr">    8 </span><span class="Comment"> * Copyright 2012 jQuery Foundation and other contributors</span>
<span class="lnr">    9 </span><span class="Comment"> * Released under the MIT license</span>
<span class="lnr">   10 </span><span class="Comment"> * <a href="http://jquery.org/license">http://jquery.org/license</a></span>
<span class="lnr">   11 </span><span class="Comment"> *</span>
<span class="lnr">   12 </span><span class="Comment"> * Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)</span>
<span class="lnr">   13 </span><span class="Comment"> */</span>
<span class="lnr">   14 </span><span class="Comment">/*</span>
<span class="lnr">   15 </span><span class="Comment"> * 1.传入window</span>
<span class="lnr">   16 </span><span class="Comment"> * 通过传入window变量,使得window由全局变量变为局部变量</span>
<span class="lnr">   17 </span><span class="Comment"> * 当在jQuery代码块中访问window时,不需要将作用域链回退到顶层作用域,这样可以更快的访问window</span>
<span class="lnr">   18 </span><span class="Comment"> * 更重要的是,将window作为参数传入,可以在压缩代码时进行优化</span>
<span class="lnr">   19 </span><span class="Comment"> * (function(a,b){})(window);window 被优化为 a,压缩后文件更小</span>
<span class="lnr">   20 </span><span class="Comment"> * 2.传入undefined</span>
<span class="lnr">   21 </span><span class="Comment"> * 是为了在&quot;自调用匿名函数&quot;的作用域内,确信undefined是真的未定义</span>
<span class="lnr">   22 </span><span class="Comment"> * 因为undefined能够被重写,赋予新的值 </span>
<span class="lnr">   23 </span><span class="Comment"> * undefined = &quot;now it's defined&quot;;</span>
<span class="lnr">   24 </span><span class="Comment"> * alert( undefined );</span>
<span class="lnr">   25 </span><span class="Comment"> * 浏览器测试结果:</span>
<span class="lnr">   26 </span><span class="Comment"> * ------------+----------------------+-------------</span>
<span class="lnr">   27 </span><span class="Comment"> *   浏览器    |    测试结果         |   结论</span>
<span class="lnr">   28 </span><span class="Comment"> *   ie        |    now it's defined  |   可以改变</span>
<span class="lnr">   29 </span><span class="Comment"> *   firefox   |    undefined       |   不能改变</span>
<span class="lnr">   30 </span><span class="Comment"> *   chrome    |    now it's defined  |   可以改变</span>
<span class="lnr">   31 </span><span class="Comment"> *   opera     |    now it's defined  |   可以改变</span>
<span class="lnr">   32 </span><span class="Comment"> * ------------+----------------------+-------------</span>
<span class="lnr">   33 </span><span class="Comment"> */</span>
<span class="lnr">   34 </span>(<span class="Identifier">function</span>( window, undefined ) {
<span class="lnr">   35 </span><span class="Type">var</span>
<span class="lnr">   36 </span><span class="Comment">    // A central reference to the root jQuery(document)</span>
<span class="lnr">   37 </span><span class="Comment">    // 对根jQuery对象的主要引用</span>
<span class="lnr">   38 </span>    rootjQuery,
<span class="lnr">   39 </span>
<span class="lnr">   40 </span><span class="Comment">    // The deferred used on DOM ready</span>
<span class="lnr">   41 </span><span class="Comment">    // 在DOM准备好时调用</span>
<span class="lnr">   42 </span>    readyList,
<span class="lnr">   43 </span>
<span class="lnr">   44 </span><span class="Comment">    // Use the correct document accordingly with window argument (sandbox)</span>
<span class="lnr">   45 </span><span class="Comment">    // 根据window参数设置正确的文档对象</span>
<span class="lnr">   46 </span>    document = window.document,
<span class="lnr">   47 </span>    location = window.location,
<span class="lnr">   48 </span>    navigator = window.navigator,
<span class="lnr">   49 </span>
<span class="lnr">   50 </span><span class="Comment">    // Map over jQuery in case of overwrite</span>
<span class="lnr">   51 </span><span class="Comment">    // 初始化前先将window.jQuery的值保留到_jQuery中,防止被jQuery覆盖</span>
<span class="lnr">   52 </span><span class="Comment">    // 调用jQuery.noConflict()后再将值复制回window.jQuery中,将符号的控制权交回</span>
<span class="lnr">   53 </span>    _jQuery = window.jQuery,
<span class="lnr">   54 </span>
<span class="lnr">   55 </span><span class="Comment">    // Map over the $ in case of overwrite</span>
<span class="lnr">   56 </span><span class="Comment">    // 初始化前先将window.$的值保留到_$中,防止被jQuery覆盖</span>
<span class="lnr">   57 </span><span class="Comment">    // 调用jQuery.noConflict()后再将值复制回window.$中,将符号的控制权交回</span>
<span class="lnr">   58 </span>    _$ = window.$,
<span class="lnr">   59 </span>
<span class="lnr">   60 </span><span class="Comment">    // Save a reference to some core methods</span>
<span class="lnr">   61 </span><span class="Comment">    // 为核心方法创建引用</span>
<span class="lnr">   62 </span>    core_push = <span class="Special">Array</span>.prototype.push,
<span class="lnr">   63 </span>    core_slice = <span class="Special">Array</span>.prototype.slice,
<span class="lnr">   64 </span>    core_indexOf = <span class="Special">Array</span>.prototype.indexOf,
<span class="lnr">   65 </span>    core_toString = <span class="Special">Object</span>.prototype.toString,
<span class="lnr">   66 </span>    core_hasOwn = <span class="Special">Object</span>.prototype.hasOwnProperty,
<span class="lnr">   67 </span>    core_trim = <span class="Special">String</span>.prototype.trim,
<span class="lnr">   68 </span>
<span class="lnr">   69 </span><span class="Comment">    // Define a local copy of jQuery</span>
<span class="lnr">   70 </span><span class="Comment">    // 构建jQuery对象</span>
<span class="lnr">   71 </span>    jQuery = <span class="Identifier">function</span>( selector, context ) {
<span class="lnr">   72 </span><span class="Comment">       // The jQuery object is actually just the init constructor 'enhanced'</span>
<span class="lnr">   73 </span>       <span class="Comment">/* </span>
<span class="lnr">   74 </span><span class="Comment">        * jQuery对象实际上只是增强的初始化构造方法,使用原型上的prototype上的init方法构建对象</span>
<span class="lnr">   75 </span><span class="Comment">        * jQuery.fn即为jQuery.prototype,通过将jQuery的原型赋给jQuery.fn.init的原型</span>
<span class="lnr">   76 </span><span class="Comment">        * 来解决使用init创建实例,创建出的对象继承的是init的prototype上的方法而不会继承jQuery prototype上的方法的问题</span>
<span class="lnr">   77 </span><span class="Comment">        */</span>
<span class="lnr">   78 </span>       <span class="Statement">return</span> <span class="Statement">new</span> jQuery.fn.init( selector, context, rootjQuery );
<span class="lnr">   79 </span>    },
<span class="lnr">   80 </span>
<span class="lnr">   81 </span><span class="Comment">    // Used for matching numbers</span>
<span class="lnr">   82 </span>    <span class="Comment">/* 用来匹配数字的正则,可匹配可选正负号,浮点型,整型,科学计数法</span>
<span class="lnr">   83 </span><span class="Comment">     * 没有使用?来表示可选而是通过|来选择</span>
<span class="lnr">   84 </span><span class="Comment">     * (?:\d*\.|)匹配浮点数时,|前的\d*\.可以匹配整数部分和小数点,小数部分由后面的\d+匹配</span>
<span class="lnr">   85 </span><span class="Comment">     * 匹配整数时,|)可以保证匹配继续向下进行,整数由后面的\d+匹配,同样的\d+在匹配整型和浮点型时负责的匹配部分不同</span>
<span class="lnr">   86 </span><span class="Comment">     * [eE][\-+]?\d+|)处理科学计数法的匹配,同样没有使用?表示可选</span>
<span class="lnr">   87 </span><span class="Comment">     */</span>
<span class="lnr">   88 </span>    core_pnum = <span class="Constant">/[</span><span class="Special">\-</span><span class="Constant">+]?(?:</span><span class="Special">\d</span><span class="Constant">*</span><span class="Special">\.</span><span class="Constant">|)</span><span class="Special">\d</span><span class="Constant">+(?:[eE][</span><span class="Special">\-</span><span class="Constant">+]?</span><span class="Special">\d</span><span class="Constant">+|)/</span>.source,
<span class="lnr">   89 </span>
<span class="lnr">   90 </span><span class="Comment">    // Used for detecting and trimming whitespace</span>
<span class="lnr">   91 </span><span class="Comment">    // 用来探测和裁剪空格</span>
<span class="lnr">   92 </span><span class="Comment">    // 匹配任何非空白字符.等价于[^ \f\n\r\t\v]</span>
<span class="lnr">   93 </span><span class="Comment">    // ' '为空格,\f为换页符,\n为换行符,\r为回车符,\t为制表符,\v为垂直制表符</span>
<span class="lnr">   94 </span>    core_rnotwhite = <span class="Constant">/</span><span class="Special">\S</span><span class="Constant">/</span>,
<span class="lnr">   95 </span><span class="Comment">    // 匹配多个任何非空白字符.等价于[ \f\n\r\t\v]+</span>
<span class="lnr">   96 </span>    core_rspace = <span class="Constant">/</span><span class="Special">\s</span><span class="Constant">+/</span>,
<span class="lnr">   97 </span>
<span class="lnr">   98 </span><span class="Comment">    // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)</span>
<span class="lnr">   99 </span><span class="Comment">    // 确信裁剪BOM和NBSP,non-breaking spaces,即nbsp,详见<a href="http://en.wikipedia.org/wiki/Nbsp">http://en.wikipedia.org/wiki/Nbsp</a> 需要特殊处理</span>
<span class="lnr">  100 </span>
<span class="lnr">  101 </span>    rtrim = <span class="Constant">/^[</span><span class="Special">\s\uFEFF\xA0</span><span class="Constant">]+|[</span><span class="Special">\s\uFEFF\xA0</span><span class="Constant">]+$/g</span>,
<span class="lnr">  102 </span>
<span class="lnr">  103 </span><span class="Comment">    // A simple way to check for HTML strings</span>
<span class="lnr">  104 </span><span class="Comment">    // 一种检查HTML字符串的简便方式</span>
<span class="lnr">  105 </span><span class="Comment">    // Prioritize #id over &lt;tag&gt; to avoid XSS via location.hash (#9521)</span>
<span class="lnr">  106 </span><span class="Comment">    // 优先检测#id,防止XSS</span>
<span class="lnr">  107 </span>    rquickExpr = <span class="Constant">/^(?:[^#&lt;]*(&lt;[</span><span class="Special">\w\W</span><span class="Constant">]+&gt;)[^&gt;]*$|#([</span><span class="Special">\w\-</span><span class="Constant">]*)$)/</span>,
<span class="lnr">  108 </span>
<span class="lnr">  109 </span><span class="Comment">    // Match a standalone tag</span>
<span class="lnr">  110 </span><span class="Comment">    // 匹配一个独立的tag,&lt;&gt;&lt;/&gt;或者&lt;/&gt;</span>
<span class="lnr">  111 </span>    rsingleTag = <span class="Constant">/^&lt;(</span><span class="Special">\w</span><span class="Constant">+)</span><span class="Special">\s</span><span class="Constant">*</span><span class="Special">\/</span><span class="Constant">?&gt;(?:&lt;</span><span class="Special">\/\1</span><span class="Constant">&gt;|)$/</span>,
<span class="lnr">  112 </span>
<span class="lnr">  113 </span><span class="Comment">    // JSON RegExp</span>
<span class="lnr">  114 </span><span class="Comment">    // 用于json格式数据校验</span>
<span class="lnr">  115 </span>    rvalidchars = <span class="Constant">/^[</span><span class="Special">\]</span><span class="Constant">,:{}</span><span class="Special">\s</span><span class="Constant">]*$/</span>,
<span class="lnr">  116 </span>    rvalidbraces = <span class="Constant">/(?:^|:|,)(?:</span><span class="Special">\s</span><span class="Constant">*</span><span class="Special">\[</span><span class="Constant">)+/g</span>,
<span class="lnr">  117 </span>    rvalidescape = <span class="Constant">/</span><span class="Special">\\</span><span class="Constant">(?:[&quot;</span><span class="Special">\\\/</span><span class="Constant">bfnrt]|u[</span><span class="Special">\d</span><span class="Constant">a-fA-F]{4})/g</span>,
<span class="lnr">  118 </span>    rvalidtokens = <span class="Constant">/&quot;[^&quot;</span><span class="Special">\\\r\n</span><span class="Constant">]*&quot;|true|false|null|-?(?:</span><span class="Special">\d\d</span><span class="Constant">*</span><span class="Special">\.</span><span class="Constant">|)</span><span class="Special">\d</span><span class="Constant">+(?:[eE][</span><span class="Special">\-</span><span class="Constant">+]?</span><span class="Special">\d</span><span class="Constant">+|)/g</span>,
<span class="lnr">  119 </span>
<span class="lnr">  120 </span><span class="Comment">    // Matches dashed string for camelizing</span>
<span class="lnr">  121 </span><span class="Comment">    // 驼峰规则的检查和修改使用的正则</span>
<span class="lnr">  122 </span>    rmsPrefix = <span class="Constant">/^-ms-/</span>,
<span class="lnr">  123 </span>    rdashAlpha = <span class="Constant">/-([</span><span class="Special">\d</span><span class="Constant">a-z])/gi</span>,
<span class="lnr">  124 </span>
<span class="lnr">  125 </span><span class="Comment">    // Used by jQuery.camelCase as callback to replace()</span>
<span class="lnr">  126 </span><span class="Comment">    // jQuery.camelCase使用的用于替换的回调</span>
<span class="lnr">  127 </span>    fcamelCase = <span class="Identifier">function</span>( all, letter ) {
<span class="lnr">  128 </span>       <span class="Statement">return</span> ( letter + <span class="Constant">&quot;&quot;</span> ).toUpperCase();
<span class="lnr">  129 </span>    },
<span class="lnr">  130 </span>
<span class="lnr">  131 </span><span class="Comment">    // The ready event handler and self cleanup method</span>
<span class="lnr">  132 </span><span class="Comment">    // ready事件的处理器,自我清理函数</span>
<span class="lnr">  133 </span>    DOMContentLoaded = <span class="Identifier">function</span>() {
<span class="lnr">  134 </span><span class="Comment">       // 判断浏览器绑定事件回调的函数,决定调用相应的解绑函数</span>
<span class="lnr">  135 </span><span class="Comment">       // attachEvent/addEventListener </span>
<span class="lnr">  136 </span>       <span class="Statement">if</span> ( document.addEventListener ) {
<span class="lnr">  137 </span>          document.removeEventListener( <span class="Constant">&quot;DOMContentLoaded&quot;</span>, DOMContentLoaded, <span class="Constant">false</span> );
<span class="lnr">  138 </span>          jQuery.ready();
<span class="lnr">  139 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( document.readyState === <span class="Constant">&quot;complete&quot;</span> ) {
<span class="lnr">  140 </span><span class="Comment">          // we're here because readyState === &quot;complete&quot; in oldIE</span>
<span class="lnr">  141 </span><span class="Comment">          // which is good enough for us to call the dom ready!</span>
<span class="lnr">  142 </span><span class="Comment">          // 在旧版本IE中使用readyState === &quot;complete&quot;可以正确判断dom ready事件</span>
<span class="lnr">  143 </span>          document.detachEvent( <span class="Constant">&quot;onreadystatechange&quot;</span>, DOMContentLoaded );
<span class="lnr">  144 </span>          jQuery.ready();
<span class="lnr">  145 </span>       }
<span class="lnr">  146 </span>    },
<span class="lnr">  147 </span>
<span class="lnr">  148 </span><span class="Comment">    // [[Class]] -&gt; type pairs</span>
<span class="lnr">  149 </span>    class2type = {};
<span class="lnr">  150 </span>
<span class="lnr">  151 </span><span class="Comment">/* </span>
<span class="lnr">  152 </span><span class="Comment"> * 将jQuery的prototype赋给jQuery.fn,缓存jQuery.prototype属性,避免频繁访问带来的额外开销</span>
<span class="lnr">  153 </span><span class="Comment"> * jQuery的构造函数是原型上的init方法,而不是function jQuery </span>
<span class="lnr">  154 </span><span class="Comment"> * 每次调用$()会用jQuery原型上的init创建一个实例 </span>
<span class="lnr">  155 </span><span class="Comment"> */</span>
<span class="lnr">  156 </span>jQuery.fn = jQuery.prototype = {
<span class="lnr">  157 </span>    <span class="Statement">constructor</span>: jQuery,
<span class="lnr">  158 </span>    <span class="Statement">init</span>: <span class="Identifier">function</span>( selector, context, rootjQuery ) {
<span class="lnr">  159 </span><span class="Comment">       // context:待查找的 DOM 元素集、文档或 jQuery 对象</span>
<span class="lnr">  160 </span>       <span class="Type">var</span> match, elem, ret, doc;
<span class="lnr">  161 </span>
<span class="lnr">  162 </span><span class="Comment">       // Handle $(&quot;&quot;), $(null), $(undefined), $(false)</span>
<span class="lnr">  163 </span><span class="Comment">       // 处理 $(&quot;&quot;), $(null), $(undefined), $(false)</span>
<span class="lnr">  164 </span>       <span class="Statement">if</span> ( !selector ) {
<span class="lnr">  165 </span>          <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr">  166 </span>       }
<span class="lnr">  167 </span>
<span class="lnr">  168 </span><span class="Comment">       // Handle $(DOMElement)</span>
<span class="lnr">  169 </span><span class="Comment">       // 处理直接传入dom对象的情况</span>
<span class="lnr">  170 </span><span class="Comment">       // 如果传入对象含有nodeType属性,则为dom对象,使用jQuery对象进行包装</span>
<span class="lnr">  171 </span>       <span class="Statement">if</span> ( selector.nodeType ) {
<span class="lnr">  172 </span>          <span class="Type">this</span>.context = <span class="Type">this</span>[<span class="Constant">0</span>] = selector;
<span class="lnr">  173 </span>          <span class="Type">this</span>.length = <span class="Constant">1</span>;
<span class="lnr">  174 </span>          <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr">  175 </span>       }
<span class="lnr">  176 </span>
<span class="lnr">  177 </span><span class="Comment">       // Handle HTML strings</span>
<span class="lnr">  178 </span><span class="Comment">       // 处理HTML字符串,根据HTML生成dom</span>
<span class="lnr">  179 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> selector === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr">  180 </span>          <span class="Comment">/* </span>
<span class="lnr">  181 </span><span class="Comment">           * 如果传入的选择器是字符类型</span>
<span class="lnr">  182 </span><span class="Comment">           * 可能是选择器,比如$('p'),也可能是需要创建的dom对象$('&lt;p&gt;foo&lt;/p&gt;')</span>
<span class="lnr">  183 </span><span class="Comment">           * 可以创建片段fragment</span>
<span class="lnr">  184 </span><span class="Comment">           */</span>
<span class="lnr">  185 </span><span class="Comment">          // 如果传入的字符串第一个和最后一个字符分别是&lt;和&gt;,并且字符串长度大于等于3,则认为需要创建dom对象</span>
<span class="lnr">  186 </span>          <span class="Statement">if</span> ( selector.charAt(<span class="Constant">0</span>) === <span class="Constant">&quot;&lt;&quot;</span> &amp;&amp; selector.charAt( selector.length - <span class="Constant">1</span> ) === <span class="Constant">&quot;&gt;&quot;</span> &amp;&amp; selector.length &gt;= <span class="Constant">3</span> ) {
<span class="lnr">  187 </span><span class="Comment">             // Assume that strings that start and end with &lt;&gt; are HTML and skip the regex check</span>
<span class="lnr">  188 </span><span class="Comment">             // 确认字符串是html标签并且跳过正则检查</span>
<span class="lnr">  189 </span>             match = [ <span class="Type">null</span>, selector, <span class="Type">null</span> ];
<span class="lnr">  190 </span>
<span class="lnr">  191 </span>          } <span class="Statement">else</span> {
<span class="lnr">  192 </span><span class="Comment">             // 对选择器进行正则检查</span>
<span class="lnr">  193 </span>             match = rquickExpr.exec( selector );
<span class="lnr">  194 </span>          }
<span class="lnr">  195 </span>
<span class="lnr">  196 </span><span class="Comment">          // Match html or make sure no context is specified for #id</span>
<span class="lnr">  197 </span><span class="Comment">          // 选择器是html字符串并且没有传入待查找的上下文</span>
<span class="lnr">  198 </span><span class="Comment">          // match[1]即为匹配到的html字符串</span>
<span class="lnr">  199 </span>          <span class="Statement">if</span> ( match &amp;&amp; (match[<span class="Constant">1</span>] || !context) ) {
<span class="lnr">  200 </span>
<span class="lnr">  201 </span><span class="Comment">             // HANDLE: $(html) -&gt; $(array)</span>
<span class="lnr">  202 </span><span class="Comment">             // match[1]不为空</span>
<span class="lnr">  203 </span>             <span class="Statement">if</span> ( match[<span class="Constant">1</span>] ) {
<span class="lnr">  204 </span><span class="Comment">                // match[1]不为空,则说明不是以#id开头的选择器,是要生成的html的代码</span>
<span class="lnr">  205 </span><span class="Comment">                // 查找上下文context可以是jQuery对象,如果是jQuery对象,则拿到其包装的dom对象</span>
<span class="lnr">  206 </span><span class="Comment">                // jQuery对象将其对应的dom对象放在0映射的value中</span>
<span class="lnr">  207 </span>                context = context <span class="Statement">instanceof</span> jQuery ? context[<span class="Constant">0</span>] : context;
<span class="lnr">  208 </span><span class="Comment">                // 问号表达式,当判断式为true的时候需要进行OR操作符的判断,OR操作符具体判断规则如下:</span>
<span class="lnr">  209 </span>                <span class="Comment">/*</span>
<span class="lnr">  210 </span><span class="Comment">                 * 如果一个运算数是对象,另一个是 Boolean 值,返回该对象.</span>
<span class="lnr">  211 </span><span class="Comment">                 * 如果两个运算数都是对象,返回第二个对象.</span>
<span class="lnr">  212 </span><span class="Comment">                 * 如果某个运算数是 null,返回 null.</span>
<span class="lnr">  213 </span><span class="Comment">                 * 如果某个运算数是 NaN,返回 NaN.</span>
<span class="lnr">  214 </span><span class="Comment">                 * 如果某个运算数是 undefined,发生错误.</span>
<span class="lnr">  215 </span><span class="Comment">                 */</span>
<span class="lnr">  216 </span><span class="Comment">                // 为true时,context.ownerDocument || context返回非null的对象,如果两个对象都不是null,则返回context</span>
<span class="lnr">  217 </span>                doc = ( context &amp;&amp; context.nodeType ? context.ownerDocument || <span class="Statement">context</span> : document );
<span class="lnr">  218 </span>
<span class="lnr">  219 </span><span class="Comment">                // scripts is true for back-compat</span>
<span class="lnr">  220 </span><span class="Comment">                // 脚本向后兼容</span>
<span class="lnr">  221 </span>                selector = jQuery.parseHTML( match[<span class="Constant">1</span>], doc, <span class="Constant">true</span> );
<span class="lnr">  222 </span>                <span class="Statement">if</span> ( rsingleTag.test( match[<span class="Constant">1</span>] ) &amp;&amp; jQuery.isPlainObject( context ) ) {
<span class="lnr">  223 </span>                   <span class="Type">this</span>.attr.call( selector, context, <span class="Constant">true</span> );
<span class="lnr">  224 </span>                }
<span class="lnr">  225 </span>
<span class="lnr">  226 </span>                <span class="Statement">return</span> jQuery.merge( <span class="Type">this</span>, selector );
<span class="lnr">  227 </span>
<span class="lnr">  228 </span><span class="Comment">             // HANDLE: $(#id)</span>
<span class="lnr">  229 </span><span class="Comment">             // 处理:$(#id)</span>
<span class="lnr">  230 </span><span class="Comment">             // 使用rootjQuery.find进行查找</span>
<span class="lnr">  231 </span>             } <span class="Statement">else</span> {
<span class="lnr">  232 </span><span class="Comment">                // match[1]为空,传入context,则要根据id获取元素</span>
<span class="lnr">  233 </span>                elem = document.getElementById( match[<span class="Constant">2</span>] );
<span class="lnr">  234 </span>
<span class="lnr">  235 </span><span class="Comment">                // Check parentNode to catch when Blackberry 4.6 returns</span>
<span class="lnr">  236 </span><span class="Comment">                // nodes that are no longer in the document #6963</span>
<span class="lnr">  237 </span><span class="Comment">                // 当黑莓4.6返回不存在于文档树的节点时,检查需要捕获的父节点</span>
<span class="lnr">  238 </span>                <span class="Statement">if</span> ( elem &amp;&amp; elem.parentNode ) {
<span class="lnr">  239 </span><span class="Comment">                   // Handle the case where IE and Opera return items</span>
<span class="lnr">  240 </span><span class="Comment">                   // by name instead of ID</span>
<span class="lnr">  241 </span><span class="Comment">                   // 处理IE和Opera使用name替代id返回的情况</span>
<span class="lnr">  242 </span>                   <span class="Statement">if</span> ( elem.id !== match[<span class="Constant">2</span>] ) {
<span class="lnr">  243 </span><span class="Comment">                      // 查找节点</span>
<span class="lnr">  244 </span>                      <span class="Statement">return</span> rootjQuery.find( selector );
<span class="lnr">  245 </span>                   }
<span class="lnr">  246 </span>
<span class="lnr">  247 </span><span class="Comment">                   // Otherwise, we inject the element directly into the jQuery object</span>
<span class="lnr">  248 </span><span class="Comment">                   // 将找到的元素的原生dom元素直接注入到jQuery对象中,保存在0这个属性中</span>
<span class="lnr">  249 </span><span class="Comment">                   // 并设置jQuery对象的length属性值为1</span>
<span class="lnr">  250 </span>                   <span class="Type">this</span>.length = <span class="Constant">1</span>;
<span class="lnr">  251 </span>                   <span class="Type">this</span>[<span class="Constant">0</span>] = elem;
<span class="lnr">  252 </span>                }
<span class="lnr">  253 </span>
<span class="lnr">  254 </span>                <span class="Type">this</span>.context = document;
<span class="lnr">  255 </span>                <span class="Type">this</span>.selector = selector;
<span class="lnr">  256 </span>                <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr">  257 </span>             }
<span class="lnr">  258 </span>
<span class="lnr">  259 </span><span class="Comment">          // HANDLE: $(expr, $(...))</span>
<span class="lnr">  260 </span><span class="Comment">          // 处理$(expr, $(...))的情况,可以指定要查找的范围</span>
<span class="lnr">  261 </span><span class="Comment">          // match[1]为空,context不为空且为jQuery对象</span>
<span class="lnr">  262 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( !context || context.jquery ) {
<span class="lnr">  263 </span>             <span class="Statement">return</span> ( context || rootjQuery ).find( selector );
<span class="lnr">  264 </span>
<span class="lnr">  265 </span><span class="Comment">          // HANDLE: $(expr, context)</span>
<span class="lnr">  266 </span><span class="Comment">          // (which is just equivalent to: $(context).find(expr)</span>
<span class="lnr">  267 </span><span class="Comment">          // 处理$(expr, context),使用$(context).find(expr)进行查找</span>
<span class="lnr">  268 </span><span class="Comment">          // match[1]为空,context不为空且不为jQuery对象,先构造为jQuery对象,再进行查找</span>
<span class="lnr">  269 </span>          } <span class="Statement">else</span> {
<span class="lnr">  270 </span>             <span class="Statement">return</span> <span class="Type">this</span>.constructor( context ).find( selector );
<span class="lnr">  271 </span>          }
<span class="lnr">  272 </span>
<span class="lnr">  273 </span><span class="Comment">       // HANDLE: $(function)</span>
<span class="lnr">  274 </span><span class="Comment">       // Shortcut for document ready</span>
<span class="lnr">  275 </span><span class="Comment">       // 允许你绑定一个在 DOM 文档载入完成后执行的函数.</span>
<span class="lnr">  276 </span><span class="Comment">       // 该函数的作用如同 $(document).ready() 一样,只不过用这个函数时,需要把页面中所有需要在 DOM 加载完成时执行的其他 $() 操作符都包装到其中来</span>
<span class="lnr">  277 </span><span class="Comment">       // 尽管从技术上来说,这个函数是可链接的,但真正以这种方式链接的情况并不多.</span>
<span class="lnr">  278 </span>
<span class="lnr">  279 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( jQuery.isFunction( selector ) ) {
<span class="lnr">  280 </span>          <span class="Statement">return</span> rootjQuery.ready( selector );
<span class="lnr">  281 </span>       }
<span class="lnr">  282 </span>
<span class="lnr">  283 </span>       <span class="Statement">if</span> ( selector.selector !== <span class="Type">undefined</span> ) {
<span class="lnr">  284 </span><span class="Comment">          // 将选择器和上下文对象保存到jQuery对象中</span>
<span class="lnr">  285 </span>          <span class="Type">this</span>.selector = selector.selector;
<span class="lnr">  286 </span>          <span class="Type">this</span>.context = selector.context;
<span class="lnr">  287 </span>       }
<span class="lnr">  288 </span>
<span class="lnr">  289 </span>       <span class="Statement">return</span> jQuery.makeArray( selector, <span class="Type">this</span> );
<span class="lnr">  290 </span>    },
<span class="lnr">  291 </span>
<span class="lnr">  292 </span><span class="Comment">    // Start with an empty selector</span>
<span class="lnr">  293 </span><span class="Comment">    // 初始化空selector</span>
<span class="lnr">  294 </span>    <span class="Statement">selector</span>: <span class="Constant">&quot;&quot;</span>,
<span class="lnr">  295 </span>
<span class="lnr">  296 </span><span class="Comment">    // The current version of jQuery being used</span>
<span class="lnr">  297 </span><span class="Comment">    // 当前使用的jQuery的版本</span>
<span class="lnr">  298 </span>    <span class="Statement">jquery</span>: <span class="Constant">&quot;1.8.1&quot;</span>,
<span class="lnr">  299 </span>
<span class="lnr">  300 </span><span class="Comment">    // The default length of a jQuery object is 0</span>
<span class="lnr">  301 </span><span class="Comment">    // jQuery对象的默认length设置为0,设置该属性为了模拟数组</span>
<span class="lnr">  302 </span>    <span class="Statement">length</span>: <span class="Constant">0</span>,
<span class="lnr">  303 </span>
<span class="lnr">  304 </span><span class="Comment">    // The number of elements contained in the matched element set</span>
<span class="lnr">  305 </span><span class="Comment">    // 匹配元素集的元素个数</span>
<span class="lnr">  306 </span>    <span class="Statement">size</span>: <span class="Identifier">function</span>() {
<span class="lnr">  307 </span>       <span class="Statement">return</span> <span class="Type">this</span>.length;
<span class="lnr">  308 </span>    },
<span class="lnr">  309 </span>
<span class="lnr">  310 </span><span class="Comment">    // 调用Array.prototype.slice</span>
<span class="lnr">  311 </span>    <span class="Statement">toArray</span>: <span class="Identifier">function</span>() {
<span class="lnr">  312 </span>       <span class="Statement">return</span> core_slice.call( <span class="Type">this</span> );
<span class="lnr">  313 </span>    },
<span class="lnr">  314 </span>
<span class="lnr">  315 </span><span class="Comment">    // Get the Nth element in the matched element set OR</span>
<span class="lnr">  316 </span><span class="Comment">    // Get the whole matched element set as a clean array</span>
<span class="lnr">  317 </span><span class="Comment">    // 获取第n个匹配元素或者获取包含匹配元素的纯数组</span>
<span class="lnr">  318 </span>    <span class="Statement">get</span>: <span class="Identifier">function</span>( num ) {
<span class="lnr">  319 </span>       <span class="Statement">return</span> num == <span class="Type">null</span> ?
<span class="lnr">  320 </span>
<span class="lnr">  321 </span><span class="Comment">          // Return a 'clean' array</span>
<span class="lnr">  322 </span><span class="Comment">          // 如果不传入序号,则返回包含匹配元素的纯数组</span>
<span class="lnr">  323 </span>          <span class="Type">this</span>.toArray() :
<span class="lnr">  324 </span>
<span class="lnr">  325 </span><span class="Comment">          // Return just the object</span>
<span class="lnr">  326 </span><span class="Comment">          // 返回匹配元素的dom对象,如果传入负数,则按照倒序取</span>
<span class="lnr">  327 </span>          ( num &lt; <span class="Constant">0</span> ? <span class="Type">this</span>[ <span class="Type">this</span>.length + num ] : <span class="Type">this</span>[ num ] );
<span class="lnr">  328 </span>    },
<span class="lnr">  329 </span>
<span class="lnr">  330 </span><span class="Comment">    // Take an array of elements and push it onto the stack</span>
<span class="lnr">  331 </span><span class="Comment">    // (returning the new matched element set)</span>
<span class="lnr">  332 </span><span class="Comment">    // 将一个DOM元素集合加入到jQuery栈</span>
<span class="lnr">  333 </span>    <span class="Comment">/*</span>
<span class="lnr">  334 </span><span class="Comment">     * 该函数配合.end(),可以用来遍历dom树</span>
<span class="lnr">  335 </span><span class="Comment">     * 当你使用fine()、parent()、filter()等jQuery提供的方法时</span>
<span class="lnr">  336 </span><span class="Comment">     * jQuery返回的是pushStack处理过的对象,对象持有原有对象的引用</span>
<span class="lnr">  337 </span><span class="Comment">     * 可以使用end()方法获取原有对象的引用</span>
<span class="lnr">  338 </span><span class="Comment">     * 参见:<a href="http://www.learningjquery.com/2011/12/using-jquerys-pushstack-for-reusable-dom-traversing-methods">http://www.learningjquery.com/2011/12/using-jquerys-pushstack-for-reusable-dom-traversing-methods</a></span>
<span class="lnr">  339 </span><span class="Comment">     */</span>
<span class="lnr">  340 </span>    <span class="Statement">pushStack</span>: <span class="Identifier">function</span>( elems, name, selector ) {
<span class="lnr">  341 </span>
<span class="lnr">  342 </span><span class="Comment">       // Build a new jQuery matched element set</span>
<span class="lnr">  343 </span><span class="Comment">       // 调用jQuery的构造方法构造一个新对象,并将dom元素集合merge到新的对象中</span>
<span class="lnr">  344 </span>       <span class="Type">var</span> ret = jQuery.merge( <span class="Type">this</span>.constructor(), elems );
<span class="lnr">  345 </span>
<span class="lnr">  346 </span><span class="Comment">       // Add the old object onto the stack (as a reference)</span>
<span class="lnr">  347 </span><span class="Comment">       // 持有就jQuery对象的引用</span>
<span class="lnr">  348 </span>       ret.prevObject = <span class="Type">this</span>;
<span class="lnr">  349 </span>
<span class="lnr">  350 </span><span class="Comment">       // 传递上下文对象</span>
<span class="lnr">  351 </span>       ret.context = <span class="Type">this</span>.context;
<span class="lnr">  352 </span>
<span class="lnr">  353 </span>       <span class="Statement">if</span> ( name === <span class="Constant">&quot;find&quot;</span> ) {
<span class="lnr">  354 </span>          ret.selector = <span class="Type">this</span>.selector + ( <span class="Type">this</span>.selector ? <span class="Constant">&quot; &quot;</span> : <span class="Constant">&quot;&quot;</span> ) + selector;
<span class="lnr">  355 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( name ) {
<span class="lnr">  356 </span>          ret.selector = <span class="Type">this</span>.selector + <span class="Constant">&quot;.&quot;</span> + name + <span class="Constant">&quot;(&quot;</span> + selector + <span class="Constant">&quot;)&quot;</span>;
<span class="lnr">  357 </span>       }
<span class="lnr">  358 </span>
<span class="lnr">  359 </span><span class="Comment">       // Return the newly-formed element set</span>
<span class="lnr">  360 </span><span class="Comment">       // 返回新的包装过的元素集合</span>
<span class="lnr">  361 </span>       <span class="Statement">return</span> ret;
<span class="lnr">  362 </span>    },
<span class="lnr">  363 </span>
<span class="lnr">  364 </span><span class="Comment">    // Execute a callback for every element in the matched set.</span>
<span class="lnr">  365 </span><span class="Comment">    // 对集合中的所有元素调用回调函数</span>
<span class="lnr">  366 </span><span class="Comment">    // (You can seed the arguments with an array of args, but this is</span>
<span class="lnr">  367 </span><span class="Comment">    // only used internally.)</span>
<span class="lnr">  368 </span><span class="Comment">    // 你可以使用一个数组来传递参数,但是这种功能只是为内部使用而提供</span>
<span class="lnr">  369 </span>    <span class="Statement">each</span>: <span class="Identifier">function</span>( callback, args ) {
<span class="lnr">  370 </span>       <span class="Statement">return</span> jQuery.each( <span class="Type">this</span>, callback, args );
<span class="lnr">  371 </span>    },
<span class="lnr">  372 </span>
<span class="lnr">  373 </span>    <span class="Statement">ready</span>: <span class="Identifier">function</span>( fn ) {
<span class="lnr">  374 </span><span class="Comment">       // Add the callback</span>
<span class="lnr">  375 </span><span class="Comment">       // 增加回调,使用jQuery.ready.promise()返回的只读Deferred对象</span>
<span class="lnr">  376 </span>       jQuery.ready.promise().done( fn );
<span class="lnr">  377 </span>
<span class="lnr">  378 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr">  379 </span>    },
<span class="lnr">  380 </span>
<span class="lnr">  381 </span><span class="Comment">    // 获取匹配集合中指定的元素</span>
<span class="lnr">  382 </span><span class="Comment">    // 使用pushStack构造新的jQuery对象</span>
<span class="lnr">  383 </span>    <span class="Statement">eq</span>: <span class="Identifier">function</span>( i ) {
<span class="lnr">  384 </span>       i = +i;
<span class="lnr">  385 </span>       <span class="Statement">return</span> i === -<span class="Constant">1</span> ?
<span class="lnr">  386 </span>          <span class="Comment">/*</span>
<span class="lnr">  387 </span><span class="Comment">           * 当slice函数的第一个参数为负数时,是倒数计数,截取逻辑是向数组的末尾方向进行截取</span>
<span class="lnr">  388 </span><span class="Comment">           * 比如数组[a,b,c,d,e,f,g],slice(-4)即为从倒数第二个元素截取到数组末尾,为[d,e,f,g]</span>
<span class="lnr">  389 </span><span class="Comment">           * slice(-4,-2)为从倒数第四个元素截取到倒数第二个元素,为[d,e]</span>
<span class="lnr">  390 </span><span class="Comment">           * 并且slice第一个参数为负时,第二个参数不能为0,所以i===-1需要特殊处理</span>
<span class="lnr">  391 </span><span class="Comment">           */</span>
<span class="lnr">  392 </span>          <span class="Type">this</span>.slice( i ) :
<span class="lnr">  393 </span>          <span class="Type">this</span>.slice( i, i + <span class="Constant">1</span> );
<span class="lnr">  394 </span>    },
<span class="lnr">  395 </span>
<span class="lnr">  396 </span><span class="Comment">    // 第一个元素</span>
<span class="lnr">  397 </span>    <span class="Statement">first</span>: <span class="Identifier">function</span>() {
<span class="lnr">  398 </span>       <span class="Statement">return</span> <span class="Type">this</span>.eq( <span class="Constant">0</span> );
<span class="lnr">  399 </span>    },
<span class="lnr">  400 </span>
<span class="lnr">  401 </span><span class="Comment">    // 最后一个元素</span>
<span class="lnr">  402 </span>    <span class="Statement">last</span>: <span class="Identifier">function</span>() {
<span class="lnr">  403 </span>       <span class="Statement">return</span> <span class="Type">this</span>.eq( -<span class="Constant">1</span> );
<span class="lnr">  404 </span>    },
<span class="lnr">  405 </span>
<span class="lnr">  406 </span><span class="Comment">    // 通过Array.prototype.slice实现数组的截取</span>
<span class="lnr">  407 </span><span class="Comment">    // 通过pushStack实现截取对象的包装</span>
<span class="lnr">  408 </span>    <span class="Statement">slice</span>: <span class="Identifier">function</span>() {
<span class="lnr">  409 </span>       <span class="Statement">return</span> <span class="Type">this</span>.pushStack( core_slice.apply( <span class="Type">this</span>, arguments ),
<span class="lnr">  410 </span>          <span class="Constant">&quot;slice&quot;</span>, core_slice.call(arguments).join(<span class="Constant">&quot;,&quot;</span>) );
<span class="lnr">  411 </span>    },
<span class="lnr">  412 </span>
<span class="lnr">  413 </span><span class="Comment">    // 遍历一个可遍历的类似数组的对象,对元素调用callback,将结果存到另一个数组中</span>
<span class="lnr">  414 </span>    <span class="Statement">map</span>: <span class="Identifier">function</span>( callback ) {
<span class="lnr">  415 </span>       <span class="Statement">return</span> <span class="Type">this</span>.pushStack( jQuery.map(<span class="Type">this</span>, <span class="Identifier">function</span>( elem, i ) {
<span class="lnr">  416 </span>          <span class="Statement">return</span> callback.call( elem, i, elem );
<span class="lnr">  417 </span>       }));
<span class="lnr">  418 </span>    },
<span class="lnr">  419 </span>
<span class="lnr">  420 </span><span class="Comment">    // 获取pushStack构造的对象中持有的原数据对象的引用</span>
<span class="lnr">  421 </span>    <span class="Statement">end</span>: <span class="Identifier">function</span>() {
<span class="lnr">  422 </span>       <span class="Statement">return</span> <span class="Type">this</span>.prevObject || <span class="Type">this</span>.constructor(<span class="Type">null</span>);
<span class="lnr">  423 </span>    },
<span class="lnr">  424 </span>
<span class="lnr">  425 </span><span class="Comment">    // For internal use only.</span>
<span class="lnr">  426 </span><span class="Comment">    // 内部使用</span>
<span class="lnr">  427 </span><span class="Comment">    // Behaves like an Array's method, not like a jQuery method.</span>
<span class="lnr">  428 </span><span class="Comment">    // 模拟数组对象的行为</span>
<span class="lnr">  429 </span>    <span class="Statement">push</span>: core_push,
<span class="lnr">  430 </span><span class="Comment">    // 调用数组的排序方法进行排序</span>
<span class="lnr">  431 </span>    <span class="Statement">sort</span>: [].sort,
<span class="lnr">  432 </span>    <span class="Statement">splice</span>: [].splice
<span class="lnr">  433 </span>};
<span class="lnr">  434 </span>
<span class="lnr">  435 </span><span class="Comment">// Give the init function the jQuery prototype for later instantiation</span>
<span class="lnr">  436 </span><span class="Comment">/*</span>
<span class="lnr">  437 </span><span class="Comment"> * 将jQuery的原型赋给jQuery.fn.init的原型,使init方法创建的对象包含jQuery原型中的方法</span>
<span class="lnr">  438 </span><span class="Comment"> * 解决如果使用init创建实例,这个对象继承的是init的prototype上的方法而不会继承jQuery prototype上的方法的问题 </span>
<span class="lnr">  439 </span><span class="Comment"> */</span>
<span class="lnr">  440 </span>jQuery.fn.init.prototype = jQuery.fn;
<span class="lnr">  441 </span>
<span class="lnr">  442 </span><span class="Comment">/*</span>
<span class="lnr">  443 </span><span class="Comment"> * 模拟面向对象的继承</span>
<span class="lnr">  444 </span><span class="Comment"> */</span>
<span class="lnr">  445 </span>jQuery.extend = jQuery.fn.extend = <span class="Identifier">function</span>() {
<span class="lnr">  446 </span>    <span class="Type">var</span> options, name, src, copy, copyIsArray, clone,
<span class="lnr">  447 </span><span class="Comment">       // 如果是否深拷贝参数为false,则直接将{}赋值给target</span>
<span class="lnr">  448 </span>       target = arguments[<span class="Constant">0</span>] || {},
<span class="lnr">  449 </span>       i = <span class="Constant">1</span>,
<span class="lnr">  450 </span>       length = arguments.length,
<span class="lnr">  451 </span>       deep = <span class="Constant">false</span>;
<span class="lnr">  452 </span>
<span class="lnr">  453 </span><span class="Comment">    // Handle a deep copy situation</span>
<span class="lnr">  454 </span><span class="Comment">    // 处理是否深拷贝,第一个参数如果是boolean类型</span>
<span class="lnr">  455 </span><span class="Comment">    // 如果为true,则会进入下面的流程进行处理</span>
<span class="lnr">  456 </span><span class="Comment">    // 如果为false,则在上面的target赋值语句被拦截</span>
<span class="lnr">  457 </span><span class="Comment">    // 则说明该参数是指明是否深拷贝的属性,对象链从第二个参数开始</span>
<span class="lnr">  458 </span>    <span class="Statement">if</span> ( <span class="Statement">typeof</span> target === <span class="Constant">&quot;boolean&quot;</span> ) {
<span class="lnr">  459 </span>       deep = target;
<span class="lnr">  460 </span>       target = arguments[<span class="Constant">1</span>] || {};
<span class="lnr">  461 </span><span class="Comment">       // skip the boolean and the target</span>
<span class="lnr">  462 </span><span class="Comment">       // 跳过参数和目标对象</span>
<span class="lnr">  463 </span>       i = <span class="Constant">2</span>;
<span class="lnr">  464 </span>    }
<span class="lnr">  465 </span>
<span class="lnr">  466 </span><span class="Comment">    // Handle case when target is a string or something (possible in deep copy)</span>
<span class="lnr">  467 </span><span class="Comment">    // 处理target是字符串或其他的情况（可能再深拷贝中出现）</span>
<span class="lnr">  468 </span>    <span class="Statement">if</span> ( <span class="Statement">typeof</span> target !== <span class="Constant">&quot;object&quot;</span> &amp;&amp; !jQuery.isFunction(target) ) {
<span class="lnr">  469 </span>       target = {};
<span class="lnr">  470 </span>    }
<span class="lnr">  471 </span>
<span class="lnr">  472 </span><span class="Comment">    // extend jQuery itself if only one argument is passed</span>
<span class="lnr">  473 </span><span class="Comment">    // 如果只传入了一个参数,将jQuery对象本身传给target</span>
<span class="lnr">  474 </span>    <span class="Statement">if</span> ( length === i ) {
<span class="lnr">  475 </span>       target = <span class="Type">this</span>;
<span class="lnr">  476 </span>       --i;
<span class="lnr">  477 </span>    }
<span class="lnr">  478 </span>
<span class="lnr">  479 </span>    <span class="Statement">for</span> ( ; i &lt; length; i++ ) {
<span class="lnr">  480 </span><span class="Comment">       // Only deal with non-null/undefined values</span>
<span class="lnr">  481 </span><span class="Comment">       // 忽略值为null和undefined的属性</span>
<span class="lnr">  482 </span>       <span class="Statement">if</span> ( (options = arguments[ i ]) != <span class="Type">null</span> ) {
<span class="lnr">  483 </span><span class="Comment">          // Extend the base object</span>
<span class="lnr">  484 </span><span class="Comment">          // 拷贝属性</span>
<span class="lnr">  485 </span>          <span class="Statement">for</span> ( name <span class="Statement">in</span> options ) {
<span class="lnr">  486 </span>             src = target[ name ];
<span class="lnr">  487 </span>             copy = options[ name ];
<span class="lnr">  488 </span>
<span class="lnr">  489 </span><span class="Comment">             // Prevent never-ending loop</span>
<span class="lnr">  490 </span><span class="Comment">             // 防止死循环</span>
<span class="lnr">  491 </span>             <span class="Statement">if</span> ( target === copy ) {
<span class="lnr">  492 </span>                <span class="Statement">continue</span>;
<span class="lnr">  493 </span>             }
<span class="lnr">  494 </span>
<span class="lnr">  495 </span><span class="Comment">             // Recurse if we're merging plain objects or arrays</span>
<span class="lnr">  496 </span><span class="Comment">             // 如果在复制对象或者数组,递归处理</span>
<span class="lnr">  497 </span>             <span class="Statement">if</span> ( deep &amp;&amp; copy &amp;&amp; ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
<span class="lnr">  498 </span>                <span class="Statement">if</span> ( copyIsArray ) {
<span class="lnr">  499 </span>                   copyIsArray = <span class="Constant">false</span>;
<span class="lnr">  500 </span>                   clone = src &amp;&amp; jQuery.isArray(src) ? src : [];
<span class="lnr">  501 </span>
<span class="lnr">  502 </span>                } <span class="Statement">else</span> {
<span class="lnr">  503 </span>                   clone = src &amp;&amp; jQuery.isPlainObject(src) ? src : {};
<span class="lnr">  504 </span>                }
<span class="lnr">  505 </span>
<span class="lnr">  506 </span><span class="Comment">                // Never move original objects, clone them</span>
<span class="lnr">  507 </span><span class="Comment">                // 复制属性</span>
<span class="lnr">  508 </span>                target[ name ] = jQuery.extend( deep, clone, copy );
<span class="lnr">  509 </span>
<span class="lnr">  510 </span><span class="Comment">             // Don't bring in undefined values</span>
<span class="lnr">  511 </span><span class="Comment">             // 不引入值为undefined的属性</span>
<span class="lnr">  512 </span>             } <span class="Statement">else</span> <span class="Statement">if</span> ( copy !== <span class="Type">undefined</span> ) {
<span class="lnr">  513 </span>                target[ name ] = copy;
<span class="lnr">  514 </span>             }
<span class="lnr">  515 </span>          }
<span class="lnr">  516 </span>       }
<span class="lnr">  517 </span>    }
<span class="lnr">  518 </span>
<span class="lnr">  519 </span><span class="Comment">    // Return the modified object</span>
<span class="lnr">  520 </span><span class="Comment">    // 返回修改后的对象</span>
<span class="lnr">  521 </span>    <span class="Statement">return</span> target;
<span class="lnr">  522 </span>};
<span class="lnr">  523 </span>
<span class="lnr">  524 </span>jQuery.extend({
<span class="lnr">  525 </span><span class="Comment">    // 解决不同库之间符号冲突的问题</span>
<span class="lnr">  526 </span>    <span class="Statement">noConflict</span>: <span class="Identifier">function</span>( deep ) {
<span class="lnr">  527 </span><span class="Comment">       // 如果window.$被jQuery占用,交出符号控制</span>
<span class="lnr">  528 </span><span class="Comment">       // 占用前的值再初始化jQuery前保留在_$中</span>
<span class="lnr">  529 </span>       <span class="Statement">if</span> ( window.$ === jQuery ) {
<span class="lnr">  530 </span>          window.$ = _$;
<span class="lnr">  531 </span>       }
<span class="lnr">  532 </span>
<span class="lnr">  533 </span><span class="Comment">       // 是否也交出jQuery符号的控制权</span>
<span class="lnr">  534 </span>       <span class="Statement">if</span> ( deep &amp;&amp; window.jQuery === jQuery ) {
<span class="lnr">  535 </span>          window.jQuery = _jQuery;
<span class="lnr">  536 </span>       }
<span class="lnr">  537 </span>
<span class="lnr">  538 </span>       <span class="Statement">return</span> jQuery;
<span class="lnr">  539 </span>    },
<span class="lnr">  540 </span>
<span class="lnr">  541 </span><span class="Comment">    // Is the DOM ready to be used? Set to true once it occurs.</span>
<span class="lnr">  542 </span><span class="Comment">    // 判断DOM是否已经可以使用,出现后将值设置为true</span>
<span class="lnr">  543 </span>    <span class="Statement">isReady</span>: <span class="Constant">false</span>,
<span class="lnr">  544 </span>
<span class="lnr">  545 </span><span class="Comment">    // A counter to track how many items to wait for before</span>
<span class="lnr">  546 </span><span class="Comment">    // the ready event fires. See #6781</span>
<span class="lnr">  547 </span><span class="Comment">    // 一个计数变量,跟踪多少项目在等待DOM完成准备事件触发</span>
<span class="lnr">  548 </span>    <span class="Statement">readyWait</span>: <span class="Constant">1</span>,
<span class="lnr">  549 </span>
<span class="lnr">  550 </span><span class="Comment">    // Hold (or release) the ready event</span>
<span class="lnr">  551 </span><span class="Comment">    // 保持或释放DOM完成事件</span>
<span class="lnr">  552 </span>    <span class="Statement">holdReady</span>: <span class="Identifier">function</span>( hold ) {
<span class="lnr">  553 </span>       <span class="Statement">if</span> ( hold ) {
<span class="lnr">  554 </span>          jQuery.readyWait++;
<span class="lnr">  555 </span>       } <span class="Statement">else</span> {
<span class="lnr">  556 </span>          jQuery.ready( <span class="Constant">true</span> );
<span class="lnr">  557 </span>       }
<span class="lnr">  558 </span>    },
<span class="lnr">  559 </span>
<span class="lnr">  560 </span><span class="Comment">    // Handle when the DOM is ready</span>
<span class="lnr">  561 </span><span class="Comment">    // 处理DOM完成事件</span>
<span class="lnr">  562 </span>    <span class="Statement">ready</span>: <span class="Identifier">function</span>( wait ) {
<span class="lnr">  563 </span>
<span class="lnr">  564 </span><span class="Comment">       // Abort if there are pending holds or we're already ready</span>
<span class="lnr">  565 </span><span class="Comment">       // 如果还有即将发生的hold事件或者已经准备好</span>
<span class="lnr">  566 </span>       <span class="Statement">if</span> ( wait === <span class="Constant">true</span> ? --jQuery.<span class="Statement">readyWait</span> : jQuery.isReady ) {
<span class="lnr">  567 </span>          <span class="Statement">return</span>;
<span class="lnr">  568 </span>       }
<span class="lnr">  569 </span>
<span class="lnr">  570 </span><span class="Comment">       // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).</span>
<span class="lnr">  571 </span><span class="Comment">       // 确信body存在,至少,防止IE太热心(ticket #5443)</span>
<span class="lnr">  572 </span>       <span class="Statement">if</span> ( !document.body ) {
<span class="lnr">  573 </span>          <span class="Statement">return</span> setTimeout( jQuery.ready, <span class="Constant">1</span> );
<span class="lnr">  574 </span>       }
<span class="lnr">  575 </span>
<span class="lnr">  576 </span><span class="Comment">       // Remember that the DOM is ready</span>
<span class="lnr">  577 </span><span class="Comment">       // 设置DOM已经完成的状态</span>
<span class="lnr">  578 </span>       jQuery.isReady = <span class="Constant">true</span>;
<span class="lnr">  579 </span>
<span class="lnr">  580 </span><span class="Comment">       // If a normal DOM Ready event fired, decrement, and wait if need be</span>
<span class="lnr">  581 </span><span class="Comment">       // 如果一个普通的DOM完成事件被触发,如果必要,进行等待</span>
<span class="lnr">  582 </span>       <span class="Statement">if</span> ( wait !== <span class="Constant">true</span> &amp;&amp; --jQuery.readyWait &gt; <span class="Constant">0</span> ) {
<span class="lnr">  583 </span>          <span class="Statement">return</span>;
<span class="lnr">  584 </span>       }
<span class="lnr">  585 </span>
<span class="lnr">  586 </span><span class="Comment">       // If there are functions bound, to execute</span>
<span class="lnr">  587 </span><span class="Comment">       // 如果绑定的有函数,执行</span>
<span class="lnr">  588 </span>       readyList.resolveWith( document, [ jQuery ] );
<span class="lnr">  589 </span>
<span class="lnr">  590 </span><span class="Comment">       // Trigger any bound ready events</span>
<span class="lnr">  591 </span><span class="Comment">       // 触发任何绑定的DOM ready事件</span>
<span class="lnr">  592 </span>       <span class="Statement">if</span> ( jQuery.fn.trigger ) {
<span class="lnr">  593 </span>          jQuery( document ).trigger(<span class="Constant">&quot;ready&quot;</span>).off(<span class="Constant">&quot;ready&quot;</span>);
<span class="lnr">  594 </span>       }
<span class="lnr">  595 </span>    },
<span class="lnr">  596 </span>
<span class="lnr">  597 </span><span class="Comment">    // See test/unit/core.js for details concerning isFunction.</span>
<span class="lnr">  598 </span><span class="Comment">    // 涉及isFunction的详细信息参见test/unit/core.js</span>
<span class="lnr">  599 </span><span class="Comment">    // Since version 1.3, DOM methods and functions like alert</span>
<span class="lnr">  600 </span><span class="Comment">    // 从1.3版本以后,DOM方法和函数,比如alert不再被支持,他们在IE上返回false</span>
<span class="lnr">  601 </span><span class="Comment">    // aren't supported. They return false on IE (#2968).</span>
<span class="lnr">  602 </span>    <span class="Statement">isFunction</span>: <span class="Identifier">function</span>( obj ) {
<span class="lnr">  603 </span>       <span class="Statement">return</span> jQuery.type(obj) === <span class="Constant">&quot;function&quot;</span>;
<span class="lnr">  604 </span>    },
<span class="lnr">  605 </span>
<span class="lnr">  606 </span><span class="Comment">    // 判断是否是数组</span>
<span class="lnr">  607 </span>    <span class="Statement">isArray</span>: <span class="Special">Array</span>.isArray || <span class="Identifier">function</span>( obj ) {
<span class="lnr">  608 </span>       <span class="Statement">return</span> jQuery.type(obj) === <span class="Constant">&quot;array&quot;</span>;
<span class="lnr">  609 </span>    },
<span class="lnr">  610 </span>
<span class="lnr">  611 </span><span class="Comment">    // 判断是否是window</span>
<span class="lnr">  612 </span>    <span class="Statement">isWindow</span>: <span class="Identifier">function</span>( obj ) {
<span class="lnr">  613 </span>       <span class="Statement">return</span> obj != <span class="Type">null</span> &amp;&amp; obj == obj.window;
<span class="lnr">  614 </span>    },
<span class="lnr">  615 </span>
<span class="lnr">  616 </span><span class="Comment">    // 判断是否是数字,isFinite判断数字是否是无穷大</span>
<span class="lnr">  617 </span>    <span class="Statement">isNumeric</span>: <span class="Identifier">function</span>( obj ) {
<span class="lnr">  618 </span>       <span class="Statement">return</span> !isNaN( parseFloat(obj) ) &amp;&amp; isFinite( obj );
<span class="lnr">  619 </span>    },
<span class="lnr">  620 </span>
<span class="lnr">  621 </span><span class="Comment">    // 获取对象类型,core_toString即为Object.prototype.toString函数</span>
<span class="lnr">  622 </span>    <span class="Statement">type</span>: <span class="Identifier">function</span>( obj ) {
<span class="lnr">  623 </span>       <span class="Statement">return</span> obj == <span class="Type">null</span> ?
<span class="lnr">  624 </span>          <span class="Special">String</span>( obj ) :
<span class="lnr">  625 </span>          class2type[ core_toString.call(obj) ] || <span class="Constant">&quot;object&quot;</span>;
<span class="lnr">  626 </span>    },
<span class="lnr">  627 </span>
<span class="lnr">  628 </span><span class="Comment">    // 是否是对象</span>
<span class="lnr">  629 </span>    <span class="Statement">isPlainObject</span>: <span class="Identifier">function</span>( obj ) {
<span class="lnr">  630 </span><span class="Comment">       // Must be an Object.</span>
<span class="lnr">  631 </span><span class="Comment">       // 必须是对象</span>
<span class="lnr">  632 </span><span class="Comment">       // Because of IE, we also have to check the presence of the constructor property.</span>
<span class="lnr">  633 </span><span class="Comment">       // 由于IE的原因,必须检查构造器属性</span>
<span class="lnr">  634 </span><span class="Comment">       // Make sure that DOM nodes and window objects don't pass through, as well</span>
<span class="lnr">  635 </span><span class="Comment">       // 确信DOM节点和window对象不被传进来</span>
<span class="lnr">  636 </span>       <span class="Statement">if</span> ( !obj || jQuery.type(obj) !== <span class="Constant">&quot;object&quot;</span> || obj.nodeType || jQuery.isWindow( obj ) ) {
<span class="lnr">  637 </span>          <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr">  638 </span>       }
<span class="lnr">  639 </span>
<span class="lnr">  640 </span>       <span class="Statement">try</span> {
<span class="lnr">  641 </span><span class="Comment">          // Not own constructor property must be Object</span>
<span class="lnr">  642 </span><span class="Comment">          // 含构造器的可能是对象</span>
<span class="lnr">  643 </span>          <span class="Statement">if</span> ( obj.constructor &amp;&amp;
<span class="lnr">  644 </span>             !core_hasOwn.call(obj, <span class="Constant">&quot;constructor&quot;</span>) &amp;&amp;
<span class="lnr">  645 </span>             !core_hasOwn.call(obj.constructor.prototype, <span class="Constant">&quot;isPrototypeOf&quot;</span>) ) {
<span class="lnr">  646 </span>             <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr">  647 </span>          }
<span class="lnr">  648 </span>       } <span class="Statement">catch</span> ( e ) {
<span class="lnr">  649 </span><span class="Comment">          // IE8,9 Will throw exceptions on certain host objects #9897</span>
<span class="lnr">  650 </span>          <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr">  651 </span>       }
<span class="lnr">  652 </span>
<span class="lnr">  653 </span><span class="Comment">       // Own properties are enumerated firstly, so to speed up,</span>
<span class="lnr">  654 </span><span class="Comment">       // 首先枚举对象属性,为了加速,只判断最后一个属性</span>
<span class="lnr">  655 </span><span class="Comment">       // if last one is own, then all properties are own.</span>
<span class="lnr">  656 </span><span class="Comment">       // 如果含有最后一个属性,一定含有所有属性</span>
<span class="lnr">  657 </span>
<span class="lnr">  658 </span>       <span class="Type">var</span> key;
<span class="lnr">  659 </span>       <span class="Statement">for</span> ( key <span class="Statement">in</span> obj ) {}
<span class="lnr">  660 </span>
<span class="lnr">  661 </span>       <span class="Statement">return</span> key === <span class="Type">undefined</span> || core_hasOwn.call( obj, key );
<span class="lnr">  662 </span>    },
<span class="lnr">  663 </span>
<span class="lnr">  664 </span><span class="Comment">    // 是否是空对象,如果没有属性,则为空对象</span>
<span class="lnr">  665 </span>    <span class="Statement">isEmptyObject</span>: <span class="Identifier">function</span>( obj ) {
<span class="lnr">  666 </span>       <span class="Type">var</span> name;
<span class="lnr">  667 </span>       <span class="Statement">for</span> ( name <span class="Statement">in</span> obj ) {
<span class="lnr">  668 </span>          <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr">  669 </span>       }
<span class="lnr">  670 </span>       <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr">  671 </span>    },
<span class="lnr">  672 </span>
<span class="lnr">  673 </span><span class="Comment">    // 错误</span>
<span class="lnr">  674 </span>    <span class="Statement">error</span>: <span class="Identifier">function</span>( msg ) {
<span class="lnr">  675 </span>       <span class="Statement">throw</span> <span class="Statement">new</span> <span class="Special">Error</span>( msg );
<span class="lnr">  676 </span>    },
<span class="lnr">  677 </span>
<span class="lnr">  678 </span><span class="Comment">    // 解析HTML字符串,生成相应的dom元素并返回</span>
<span class="lnr">  679 </span><span class="Comment">    // data: string of html</span>
<span class="lnr">  680 </span><span class="Comment">    // data: html字符串表示</span>
<span class="lnr">  681 </span><span class="Comment">    // context (optional): If specified, the fragment will be created in this context, defaults to document</span>
<span class="lnr">  682 </span><span class="Comment">    // context (可选的) : 如果指定,片段会被创建到该上下文上,默认是创建在document上</span>
<span class="lnr">  683 </span><span class="Comment">    // scripts (optional): If true, will include scripts passed in the html string</span>
<span class="lnr">  684 </span><span class="Comment">    // scripts (可选的) : 如果为true,会包含在html字符串中包含的脚本</span>
<span class="lnr">  685 </span>    <span class="Statement">parseHTML</span>: <span class="Identifier">function</span>( data, context, scripts ) {
<span class="lnr">  686 </span>       <span class="Type">var</span> parsed;
<span class="lnr">  687 </span>       <span class="Statement">if</span> ( !data || <span class="Statement">typeof</span> data !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr">  688 </span>          <span class="Statement">return</span> <span class="Type">null</span>;
<span class="lnr">  689 </span>       }
<span class="lnr">  690 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> context === <span class="Constant">&quot;boolean&quot;</span> ) {
<span class="lnr">  691 </span><span class="Comment">          // 如果context是布尔类型,则将context的值赋给scripts,并将context设置为0</span>
<span class="lnr">  692 </span>          scripts = context;
<span class="lnr">  693 </span>          context = <span class="Constant">0</span>;
<span class="lnr">  694 </span>       }
<span class="lnr">  695 </span>       context = context || document;
<span class="lnr">  696 </span>
<span class="lnr">  697 </span><span class="Comment">       // Single tag</span>
<span class="lnr">  698 </span><span class="Comment">       // 判断是否是单一标签,创建该dom元素后返回</span>
<span class="lnr">  699 </span>       <span class="Statement">if</span> ( (parsed = rsingleTag.exec( data )) ) {
<span class="lnr">  700 </span>          <span class="Statement">return</span> [ context.createElement( parsed[<span class="Constant">1</span>] ) ];
<span class="lnr">  701 </span>       }
<span class="lnr">  702 </span>
<span class="lnr">  703 </span><span class="Comment">       // 多标签,生成片段</span>
<span class="lnr">  704 </span>       parsed = jQuery.buildFragment( [ data ], context, scripts ? <span class="Type">null</span> : [] );
<span class="lnr">  705 </span>       <span class="Statement">return</span> jQuery.merge( [],
<span class="lnr">  706 </span>          (parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
<span class="lnr">  707 </span>    },
<span class="lnr">  708 </span>
<span class="lnr">  709 </span><span class="Comment">    // 转换JSON字符串</span>
<span class="lnr">  710 </span>    <span class="Statement">parseJSON</span>: <span class="Identifier">function</span>( data ) {
<span class="lnr">  711 </span>       <span class="Statement">if</span> ( !data || <span class="Statement">typeof</span> data !== <span class="Constant">&quot;string&quot;</span>) {
<span class="lnr">  712 </span>          <span class="Statement">return</span> <span class="Type">null</span>;
<span class="lnr">  713 </span>       }
<span class="lnr">  714 </span>
<span class="lnr">  715 </span><span class="Comment">       // Make sure leading/trailing whitespace is removed (IE can't handle it)</span>
<span class="lnr">  716 </span><span class="Comment">       // 确信开头和末尾的空白字符已经被去掉（IE无法处理该问题）</span>
<span class="lnr">  717 </span>       data = jQuery.trim( data );
<span class="lnr">  718 </span>
<span class="lnr">  719 </span><span class="Comment">       // Attempt to parse using the native JSON parser first</span>
<span class="lnr">  720 </span><span class="Comment">       // 尝试使用内置JSON解析器进行处理</span>
<span class="lnr">  721 </span>       <span class="Statement">if</span> ( window.JSON &amp;&amp; window.JSON.parse ) {
<span class="lnr">  722 </span>          <span class="Statement">return</span> window.JSON.parse( data );
<span class="lnr">  723 </span>       }
<span class="lnr">  724 </span>
<span class="lnr">  725 </span><span class="Comment">       // Make sure the incoming data is actual JSON</span>
<span class="lnr">  726 </span><span class="Comment">       // 确信输入的数据是JSON数据</span>
<span class="lnr">  727 </span><span class="Comment">       // Logic borrowed from <a href="http://json.org/json2.js">http://json.org/json2.js</a></span>
<span class="lnr">  728 </span><span class="Comment">       // 从<a href="http://json.org/json2.js中借用逻辑">http://json.org/json2.js中借用逻辑</a></span>
<span class="lnr">  729 </span>       <span class="Statement">if</span> ( rvalidchars.test( data.replace( rvalidescape, <span class="Constant">&quot;@&quot;</span> )
<span class="lnr">  730 </span>          .replace( rvalidtokens, <span class="Constant">&quot;]&quot;</span> )
<span class="lnr">  731 </span>          .replace( rvalidbraces, <span class="Constant">&quot;&quot;</span>)) ) {
<span class="lnr">  732 </span>
<span class="lnr">  733 </span>          <span class="Statement">return</span> ( <span class="Statement">new</span> <span class="Special">Function</span>( <span class="Constant">&quot;return &quot;</span> + data ) )();
<span class="lnr">  734 </span>
<span class="lnr">  735 </span>       }
<span class="lnr">  736 </span>       jQuery.error( <span class="Constant">&quot;Invalid JSON: &quot;</span> + data );
<span class="lnr">  737 </span>    },
<span class="lnr">  738 </span>
<span class="lnr">  739 </span><span class="Comment">    // Cross-browser xml parsing</span>
<span class="lnr">  740 </span><span class="Comment">    // 跨浏览器的xml解析</span>
<span class="lnr">  741 </span>    <span class="Statement">parseXML</span>: <span class="Identifier">function</span>( data ) {
<span class="lnr">  742 </span>       <span class="Type">var</span> xml, tmp;
<span class="lnr">  743 </span><span class="Comment">       // 如果传入的不是字符串,返回null</span>
<span class="lnr">  744 </span>       <span class="Statement">if</span> ( !data || <span class="Statement">typeof</span> data !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr">  745 </span>          <span class="Statement">return</span> <span class="Type">null</span>;
<span class="lnr">  746 </span>       }
<span class="lnr">  747 </span>       <span class="Statement">try</span> {
<span class="lnr">  748 </span><span class="Comment">          // 普通解析方式,文艺解析方式</span>
<span class="lnr">  749 </span>          <span class="Statement">if</span> ( window.DOMParser ) { <span class="Comment">// Standard</span>
<span class="lnr">  750 </span>             tmp = <span class="Statement">new</span> DOMParser();
<span class="lnr">  751 </span>             xml = tmp.parseFromString( data , <span class="Constant">&quot;text/xml&quot;</span> );
<span class="lnr">  752 </span><span class="Comment">          // IE解析方式</span>
<span class="lnr">  753 </span>          } <span class="Statement">else</span> { <span class="Comment">// IE</span>
<span class="lnr">  754 </span>             xml = <span class="Statement">new</span> ActiveXObject( <span class="Constant">&quot;Microsoft.XMLDOM&quot;</span> );
<span class="lnr">  755 </span>             xml.async = <span class="Constant">&quot;false&quot;</span>;
<span class="lnr">  756 </span>             xml.loadXML( data );
<span class="lnr">  757 </span>          }
<span class="lnr">  758 </span>       } <span class="Statement">catch</span>( e ) {
<span class="lnr">  759 </span>          xml = <span class="Type">undefined</span>;
<span class="lnr">  760 </span>       }
<span class="lnr">  761 </span>       <span class="Statement">if</span> ( !xml || !xml.documentElement || xml.getElementsByTagName( <span class="Constant">&quot;parsererror&quot;</span> ).length ) {
<span class="lnr">  762 </span>          jQuery.error( <span class="Constant">&quot;Invalid XML: &quot;</span> + data );
<span class="lnr">  763 </span>       }
<span class="lnr">  764 </span>       <span class="Statement">return</span> xml;
<span class="lnr">  765 </span>    },
<span class="lnr">  766 </span>
<span class="lnr">  767 </span>    <span class="Statement">noop</span>: <span class="Identifier">function</span>() {},
<span class="lnr">  768 </span>
<span class="lnr">  769 </span><span class="Comment">    // Evaluates a script in a global context</span>
<span class="lnr">  770 </span><span class="Comment">    // 在全局上下文执行脚本</span>
<span class="lnr">  771 </span><span class="Comment">    // Workarounds based on findings by Jim Driscoll</span>
<span class="lnr">  772 </span><span class="Comment">    // <a href="http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context">http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context</a></span>
<span class="lnr">  773 </span>    <span class="Statement">globalEval</span>: <span class="Identifier">function</span>( data ) {
<span class="lnr">  774 </span>       <span class="Statement">if</span> ( data &amp;&amp; core_rnotwhite.test( data ) ) {
<span class="lnr">  775 </span><span class="Comment">          // We use execScript on Internet Explorer</span>
<span class="lnr">  776 </span><span class="Comment">          // 在IE中使用execScript</span>
<span class="lnr">  777 </span><span class="Comment">          // We use an anonymous function so that context is window</span>
<span class="lnr">  778 </span><span class="Comment">          // rather than jQuery in Firefox</span>
<span class="lnr">  779 </span><span class="Comment">          // 在firefox中使用匿名函数</span>
<span class="lnr">  780 </span>          ( window.execScript || <span class="Identifier">function</span>( data ) {
<span class="lnr">  781 </span>             window[ <span class="Constant">&quot;eval&quot;</span> ].call( window, data );
<span class="lnr">  782 </span>          } )( data );
<span class="lnr">  783 </span>       }
<span class="lnr">  784 </span>    },
<span class="lnr">  785 </span>
<span class="lnr">  786 </span><span class="Comment">    // Convert dashed to camelCase; used by the css and data modules</span>
<span class="lnr">  787 </span><span class="Comment">    // 转换为驼峰规则,在css和数据模块中使用</span>
<span class="lnr">  788 </span><span class="Comment">    // Microsoft forgot to hump their vendor prefix (#9572)</span>
<span class="lnr">  789 </span><span class="Comment">    // 微软忘了把他们的前缀ms-转换为驼峰规则</span>
<span class="lnr">  790 </span>    <span class="Statement">camelCase</span>: <span class="Identifier">function</span>( string ) {
<span class="lnr">  791 </span>       <span class="Statement">return</span> string.replace( rmsPrefix, <span class="Constant">&quot;ms-&quot;</span> ).replace( rdashAlpha, fcamelCase );
<span class="lnr">  792 </span>    },
<span class="lnr">  793 </span>
<span class="lnr">  794 </span><span class="Comment">    // 判断dom元素的节点名称和name是否一样</span>
<span class="lnr">  795 </span>    <span class="Statement">nodeName</span>: <span class="Identifier">function</span>( elem, name ) {
<span class="lnr">  796 </span>       <span class="Statement">return</span> elem.nodeName &amp;&amp; elem.nodeName.toUpperCase() === name.toUpperCase();
<span class="lnr">  797 </span>    },
<span class="lnr">  798 </span>
<span class="lnr">  799 </span><span class="Comment">    // args is for internal usage only</span>
<span class="lnr">  800 </span><span class="Comment">    // args参数只在脚本内部实用</span>
<span class="lnr">  801 </span>    <span class="Statement">each</span>: <span class="Identifier">function</span>( obj, callback, args ) {
<span class="lnr">  802 </span>       <span class="Type">var</span> name,
<span class="lnr">  803 </span>          i = <span class="Constant">0</span>,
<span class="lnr">  804 </span>          length = obj.length,
<span class="lnr">  805 </span>          isObj = length === <span class="Type">undefined</span> || jQuery.isFunction( obj );
<span class="lnr">  806 </span>
<span class="lnr">  807 </span>       <span class="Statement">if</span> ( args ) {
<span class="lnr">  808 </span>          <span class="Statement">if</span> ( isObj ) {
<span class="lnr">  809 </span><span class="Comment">             // 如果是对象,遍历属性</span>
<span class="lnr">  810 </span>             <span class="Statement">for</span> ( name <span class="Statement">in</span> obj ) {
<span class="lnr">  811 </span>                <span class="Statement">if</span> ( callback.apply( obj[ name ], args ) === <span class="Constant">false</span> ) {
<span class="lnr">  812 </span>                   <span class="Statement">break</span>;
<span class="lnr">  813 </span>                }
<span class="lnr">  814 </span>             }
<span class="lnr">  815 </span>          } <span class="Statement">else</span> {
<span class="lnr">  816 </span><span class="Comment">             // 使用类似遍历数组的方式进行遍历</span>
<span class="lnr">  817 </span>             <span class="Statement">for</span> ( ; i &lt; length; ) {
<span class="lnr">  818 </span>                <span class="Statement">if</span> ( callback.apply( obj[ i++ ], args ) === <span class="Constant">false</span> ) {
<span class="lnr">  819 </span>                   <span class="Statement">break</span>;
<span class="lnr">  820 </span>                }
<span class="lnr">  821 </span>             }
<span class="lnr">  822 </span>          }
<span class="lnr">  823 </span>
<span class="lnr">  824 </span><span class="Comment">       // A special, fast, case for the most common use of each</span>
<span class="lnr">  825 </span><span class="Comment">       // 一个特殊、快速、可以应付大部分普通情况的each</span>
<span class="lnr">  826 </span>       } <span class="Statement">else</span> {
<span class="lnr">  827 </span>          <span class="Statement">if</span> ( isObj ) {
<span class="lnr">  828 </span>             <span class="Statement">for</span> ( name <span class="Statement">in</span> obj ) {
<span class="lnr">  829 </span><span class="Comment">                // 如果函数返回false,跳出循环</span>
<span class="lnr">  830 </span>                <span class="Statement">if</span> ( callback.call( obj[ name ], name, obj[ name ] ) === <span class="Constant">false</span> ) {
<span class="lnr">  831 </span>                   <span class="Statement">break</span>;
<span class="lnr">  832 </span>                }
<span class="lnr">  833 </span>             }
<span class="lnr">  834 </span>          } <span class="Statement">else</span> {
<span class="lnr">  835 </span>             <span class="Statement">for</span> ( ; i &lt; length; ) {
<span class="lnr">  836 </span>                <span class="Statement">if</span> ( callback.call( obj[ i ], i, obj[ i++ ] ) === <span class="Constant">false</span> ) {
<span class="lnr">  837 </span>                   <span class="Statement">break</span>;
<span class="lnr">  838 </span>                }
<span class="lnr">  839 </span>             }
<span class="lnr">  840 </span>          }
<span class="lnr">  841 </span>       }
<span class="lnr">  842 </span>
<span class="lnr">  843 </span><span class="Comment">       // 返回调用对象</span>
<span class="lnr">  844 </span>       <span class="Statement">return</span> obj;
<span class="lnr">  845 </span>    },
<span class="lnr">  846 </span>
<span class="lnr">  847 </span><span class="Comment">    // Use native String.trim function wherever possible</span>
<span class="lnr">  848 </span><span class="Comment">    // 尽可能得使用本地的String.trim</span>
<span class="lnr">  849 </span>    <span class="Statement">trim</span>: core_trim &amp;&amp; !core_trim.call(<span class="Constant">&quot;</span><span class="Special">\uFEFF\xA0</span><span class="Constant">&quot;</span>) ?
<span class="lnr">  850 </span>       <span class="Identifier">function</span>( text ) {
<span class="lnr">  851 </span><span class="Comment">          // 如果trim的字符串为null,返回空字符串</span>
<span class="lnr">  852 </span>          <span class="Statement">return</span> text == <span class="Type">null</span> ?
<span class="lnr">  853 </span>             <span class="Constant">&quot;&quot;</span> :
<span class="lnr">  854 </span>             core_trim.call( text );
<span class="lnr">  855 </span>       } :
<span class="lnr">  856 </span>
<span class="lnr">  857 </span><span class="Comment">       // Otherwise use our own trimming functionality</span>
<span class="lnr">  858 </span><span class="Comment">       // 如果没有,则使用jQuery的trim函数</span>
<span class="lnr">  859 </span>       <span class="Identifier">function</span>( text ) {
<span class="lnr">  860 </span>          <span class="Statement">return</span> text == <span class="Type">null</span> ?
<span class="lnr">  861 </span>             <span class="Constant">&quot;&quot;</span> :
<span class="lnr">  862 </span>             text.toString().replace( rtrim, <span class="Constant">&quot;&quot;</span> );
<span class="lnr">  863 </span>       },
<span class="lnr">  864 </span>
<span class="lnr">  865 </span><span class="Comment">    // results is for internal usage only</span>
<span class="lnr">  866 </span><span class="Comment">    // results参数只提供给内部使用</span>
<span class="lnr">  867 </span>    <span class="Statement">makeArray</span>: <span class="Identifier">function</span>( arr, results ) {
<span class="lnr">  868 </span>       <span class="Type">var</span> type,
<span class="lnr">  869 </span>          ret = results || [];
<span class="lnr">  870 </span>
<span class="lnr">  871 </span>       <span class="Statement">if</span> ( arr != <span class="Type">null</span> ) {
<span class="lnr">  872 </span><span class="Comment">          // The window, strings (and functions) also have 'length'</span>
<span class="lnr">  873 </span><span class="Comment">          // 窗口对象,字符串和函数也有length属性</span>
<span class="lnr">  874 </span><span class="Comment">          // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930</span>
<span class="lnr">  875 </span>          type = jQuery.type( arr );
<span class="lnr">  876 </span>
<span class="lnr">  877 </span><span class="Comment">          // 如果只是个对象且无法遍历,简单使用数组进行包装</span>
<span class="lnr">  878 </span>          <span class="Statement">if</span> ( arr.length == <span class="Type">null</span> || type === <span class="Constant">&quot;string&quot;</span> || type === <span class="Constant">&quot;function&quot;</span> || type === <span class="Constant">&quot;regexp&quot;</span> || jQuery.isWindow( arr ) ) {
<span class="lnr">  879 </span>             core_push.call( ret, arr );
<span class="lnr">  880 </span>          } <span class="Statement">else</span> {
<span class="lnr">  881 </span><span class="Comment">             // 调用jQuery.merge方法</span>
<span class="lnr">  882 </span>             jQuery.merge( ret, arr );
<span class="lnr">  883 </span>          }
<span class="lnr">  884 </span>       }
<span class="lnr">  885 </span>
<span class="lnr">  886 </span>       <span class="Statement">return</span> ret;
<span class="lnr">  887 </span>    },
<span class="lnr">  888 </span>
<span class="lnr">  889 </span><span class="Comment">    // 判断是否在数组中</span>
<span class="lnr">  890 </span>    <span class="Statement">inArray</span>: <span class="Identifier">function</span>( elem, arr, i ) {
<span class="lnr">  891 </span>       <span class="Type">var</span> len;
<span class="lnr">  892 </span>
<span class="lnr">  893 </span>       <span class="Statement">if</span> ( arr ) {
<span class="lnr">  894 </span><span class="Comment">          // 优先调用indexOf方法</span>
<span class="lnr">  895 </span>          <span class="Statement">if</span> ( core_indexOf ) {
<span class="lnr">  896 </span>             <span class="Statement">return</span> core_indexOf.call( arr, elem, i );
<span class="lnr">  897 </span>          }
<span class="lnr">  898 </span>
<span class="lnr">  899 </span>          len = arr.length;
<span class="lnr">  900 </span><span class="Comment">          // 处理i的值,如果转换为布尔类型为false,返回0</span>
<span class="lnr">  901 </span><span class="Comment">          // 如果是非0数字,再根据正负进行处理</span>
<span class="lnr">  902 </span>          i = i ? i &lt; <span class="Constant">0</span> ? <span class="Special">Math</span>.max( <span class="Constant">0</span>, len + i ) : <span class="Statement">i</span> : <span class="Constant">0</span>;
<span class="lnr">  903 </span>
<span class="lnr">  904 </span>          <span class="Statement">for</span> ( ; i &lt; len; i++ ) {
<span class="lnr">  905 </span><span class="Comment">             // Skip accessing in sparse arrays</span>
<span class="lnr">  906 </span><span class="Comment">             // 跳过稀疏数组</span>
<span class="lnr">  907 </span>             <span class="Statement">if</span> ( i <span class="Statement">in</span> arr &amp;&amp; arr[ i ] === elem ) {
<span class="lnr">  908 </span>                <span class="Statement">return</span> i;
<span class="lnr">  909 </span>             }
<span class="lnr">  910 </span>          }
<span class="lnr">  911 </span>       }
<span class="lnr">  912 </span>
<span class="lnr">  913 </span>       <span class="Statement">return</span> -<span class="Constant">1</span>;
<span class="lnr">  914 </span>    },
<span class="lnr">  915 </span>
<span class="lnr">  916 </span><span class="Comment">    // 合并两个对象</span>
<span class="lnr">  917 </span>    <span class="Statement">merge</span>: <span class="Identifier">function</span>( first, second ) {
<span class="lnr">  918 </span>       <span class="Type">var</span> l = second.length,
<span class="lnr">  919 </span>          i = first.length,
<span class="lnr">  920 </span>          j = <span class="Constant">0</span>;
<span class="lnr">  921 </span>
<span class="lnr">  922 </span><span class="Comment">       // 如果要合并的两个对象的length属性为number,进行追加合并</span>
<span class="lnr">  923 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> l === <span class="Constant">&quot;number&quot;</span> ) {
<span class="lnr">  924 </span>          <span class="Statement">for</span> ( ; j &lt; l; j++ ) {
<span class="lnr">  925 </span>             first[ i++ ] = second[ j ];
<span class="lnr">  926 </span>          }
<span class="lnr">  927 </span>
<span class="lnr">  928 </span>       } <span class="Statement">else</span> {
<span class="lnr">  929 </span><span class="Comment">          // 如果要合并的两个对象的length属性不为number,则进行属性追加</span>
<span class="lnr">  930 </span><span class="Comment">          // foo{0:a,1:b,2:c},bar{0:d,1:e}合并后为foo{0:a,1:b,2:c,3:d,4:e}</span>
<span class="lnr">  931 </span>          <span class="Statement">while</span> ( second[j] !== <span class="Type">undefined</span> ) {
<span class="lnr">  932 </span>             first[ i++ ] = second[ j++ ];
<span class="lnr">  933 </span>          }
<span class="lnr">  934 </span>       }
<span class="lnr">  935 </span>
<span class="lnr">  936 </span><span class="Comment">       // 设置length,合并过后的对象一定会有一个length属性</span>
<span class="lnr">  937 </span>       first.length = i;
<span class="lnr">  938 </span>
<span class="lnr">  939 </span>       <span class="Statement">return</span> first;
<span class="lnr">  940 </span>    },
<span class="lnr">  941 </span>
<span class="lnr">  942 </span>    <span class="Comment">/*</span>
<span class="lnr">  943 </span><span class="Comment">     * elems 要处理的数组</span>
<span class="lnr">  944 </span><span class="Comment">     * callback 在每个数组元素上调用的函数</span>
<span class="lnr">  945 </span><span class="Comment">     * inv 指示进行选取还是过滤</span>
<span class="lnr">  946 </span><span class="Comment">     * inv为false,保留调用callback返回true的元素</span>
<span class="lnr">  947 </span><span class="Comment">     * inv为true,保留调用callback为false的元素</span>
<span class="lnr">  948 </span><span class="Comment">     */</span>
<span class="lnr">  949 </span>    <span class="Statement">grep</span>: <span class="Identifier">function</span>( elems, callback, inv ) {
<span class="lnr">  950 </span>       <span class="Type">var</span> retVal,
<span class="lnr">  951 </span>          ret = [],
<span class="lnr">  952 </span>          i = <span class="Constant">0</span>,
<span class="lnr">  953 </span>          length = elems.length;
<span class="lnr">  954 </span><span class="Comment">       // 将inv转换由任何类型转换为布尔类型</span>
<span class="lnr">  955 </span>       inv = !!inv;
<span class="lnr">  956 </span>
<span class="lnr">  957 </span><span class="Comment">       // Go through the array, only saving the items</span>
<span class="lnr">  958 </span><span class="Comment">       // that pass the validator function</span>
<span class="lnr">  959 </span>       <span class="Statement">for</span> ( ; i &lt; length; i++ ) {
<span class="lnr">  960 </span><span class="Comment">          // 在每个数组元素上调用回调</span>
<span class="lnr">  961 </span>          retVal = !!callback( elems[ i ], i );
<span class="lnr">  962 </span>          <span class="Statement">if</span> ( inv !== retVal ) {
<span class="lnr">  963 </span>             ret.push( elems[ i ] );
<span class="lnr">  964 </span>          }
<span class="lnr">  965 </span>       }
<span class="lnr">  966 </span>
<span class="lnr">  967 </span>       <span class="Statement">return</span> ret;
<span class="lnr">  968 </span>    },
<span class="lnr">  969 </span>
<span class="lnr">  970 </span><span class="Comment">    // arg is for internal usage only</span>
<span class="lnr">  971 </span><span class="Comment">    // arg参数仅供内部使用</span>
<span class="lnr">  972 </span>    <span class="Statement">map</span>: <span class="Identifier">function</span>( elems, callback, arg ) {
<span class="lnr">  973 </span>       <span class="Type">var</span> value, key,
<span class="lnr">  974 </span>          ret = [],
<span class="lnr">  975 </span>          i = <span class="Constant">0</span>,
<span class="lnr">  976 </span>          length = elems.length,
<span class="lnr">  977 </span><span class="Comment">          // jquery objects are treated as arrays</span>
<span class="lnr">  978 </span><span class="Comment">          // jQuery对象被当做数组来使用</span>
<span class="lnr">  979 </span>          isArray = elems <span class="Statement">instanceof</span> jQuery || length !== <span class="Type">undefined</span> &amp;&amp; <span class="Statement">typeof</span> length === <span class="Constant">&quot;number&quot;</span> &amp;&amp; ( ( length &gt; <span class="Constant">0</span> &amp;&amp; elems[ <span class="Constant">0</span> ] &amp;&amp; elems[ length -<span class="Constant">1</span> ] ) || length === <span class="Constant">0</span> || jQuery.isArray( elems ) ) ;
<span class="lnr">  980 </span>
<span class="lnr">  981 </span><span class="Comment">       // Go through the array, translating each of the items to their</span>
<span class="lnr">  982 </span><span class="Comment">       // 遍历数组</span>
<span class="lnr">  983 </span>       <span class="Statement">if</span> ( isArray ) {
<span class="lnr">  984 </span>          <span class="Statement">for</span> ( ; i &lt; length; i++ ) {
<span class="lnr">  985 </span>             value = callback( elems[ i ], i, arg );
<span class="lnr">  986 </span>
<span class="lnr">  987 </span><span class="Comment">             // 忽略调用callback返回值为null的属性</span>
<span class="lnr">  988 </span>             <span class="Statement">if</span> ( value != <span class="Type">null</span> ) {
<span class="lnr">  989 </span>                ret[ ret.length ] = value;
<span class="lnr">  990 </span>             }
<span class="lnr">  991 </span>          }
<span class="lnr">  992 </span>
<span class="lnr">  993 </span><span class="Comment">       // Go through every key on the object,</span>
<span class="lnr">  994 </span><span class="Comment">       // 遍历对象的每一个属性</span>
<span class="lnr">  995 </span>       } <span class="Statement">else</span> {
<span class="lnr">  996 </span>          <span class="Statement">for</span> ( key <span class="Statement">in</span> elems ) {
<span class="lnr">  997 </span>             value = callback( elems[ key ], key, arg );
<span class="lnr">  998 </span>
<span class="lnr">  999 </span><span class="Comment">             // 忽略调用callback返回值为null的属性</span>
<span class="lnr"> 1000 </span>             <span class="Statement">if</span> ( value != <span class="Type">null</span> ) {
<span class="lnr"> 1001 </span>                ret[ ret.length ] = value;
<span class="lnr"> 1002 </span>             }
<span class="lnr"> 1003 </span>          }
<span class="lnr"> 1004 </span>       }
<span class="lnr"> 1005 </span>
<span class="lnr"> 1006 </span><span class="Comment">       // Flatten any nested arrays</span>
<span class="lnr"> 1007 </span><span class="Comment">       // 返回纯净的数组对象</span>
<span class="lnr"> 1008 </span>       <span class="Statement">return</span> ret.concat.apply( [], ret );
<span class="lnr"> 1009 </span>    },
<span class="lnr"> 1010 </span>
<span class="lnr"> 1011 </span><span class="Comment">    // A global GUID counter for objects</span>
<span class="lnr"> 1012 </span><span class="Comment">    // 全局的对象GUID计数器</span>
<span class="lnr"> 1013 </span>    <span class="Statement">guid</span>: <span class="Constant">1</span>,
<span class="lnr"> 1014 </span>
<span class="lnr"> 1015 </span><span class="Comment">    // Bind a function to a context, optionally partially applying any</span>
<span class="lnr"> 1016 </span><span class="Comment">    // arguments.</span>
<span class="lnr"> 1017 </span><span class="Comment">    // 为一个函数绑定上下文对象,主要是为了保证函数中的this关键字有意义</span>
<span class="lnr"> 1018 </span>    <span class="Statement">proxy</span>: <span class="Identifier">function</span>( fn, context ) {
<span class="lnr"> 1019 </span>       <span class="Type">var</span> tmp, args, proxy;
<span class="lnr"> 1020 </span>
<span class="lnr"> 1021 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> context === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 1022 </span>          tmp = fn[ context ];
<span class="lnr"> 1023 </span>          context = fn;
<span class="lnr"> 1024 </span>          fn = tmp;
<span class="lnr"> 1025 </span>       }
<span class="lnr"> 1026 </span>
<span class="lnr"> 1027 </span><span class="Comment">       // Quick check to determine if target is callable, in the spec</span>
<span class="lnr"> 1028 </span><span class="Comment">       // this throws a TypeError, but we will just return undefined.</span>
<span class="lnr"> 1029 </span><span class="Comment">       // 快速确定目标函数是否是可调用的,检查会抛出一个类型错误的异常</span>
<span class="lnr"> 1030 </span><span class="Comment">       // 该函数只会返回一个undefined</span>
<span class="lnr"> 1031 </span>       <span class="Statement">if</span> ( !jQuery.isFunction( fn ) ) {
<span class="lnr"> 1032 </span>          <span class="Statement">return</span> <span class="Type">undefined</span>;
<span class="lnr"> 1033 </span>       }
<span class="lnr"> 1034 </span>
<span class="lnr"> 1035 </span><span class="Comment">       // Simulated bind</span>
<span class="lnr"> 1036 </span><span class="Comment">       // 绑定上下文,准备参数</span>
<span class="lnr"> 1037 </span>       args = core_slice.call( arguments, <span class="Constant">2</span> );
<span class="lnr"> 1038 </span>       proxy = <span class="Identifier">function</span>() {
<span class="lnr"> 1039 </span>          <span class="Statement">return</span> fn.apply( context, args.concat( core_slice.call( arguments ) ) );
<span class="lnr"> 1040 </span>       };
<span class="lnr"> 1041 </span>
<span class="lnr"> 1042 </span><span class="Comment">       // Set the guid of unique handler to the same of original handler, so it can be removed</span>
<span class="lnr"> 1043 </span><span class="Comment">       // 将特别handler的GUID和原始handler的GUID设置为同一个,使其可以被移除</span>
<span class="lnr"> 1044 </span>       proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
<span class="lnr"> 1045 </span>
<span class="lnr"> 1046 </span>       <span class="Statement">return</span> proxy;
<span class="lnr"> 1047 </span>    },
<span class="lnr"> 1048 </span>
<span class="lnr"> 1049 </span><span class="Comment">    // Multifunctional method to get and set values of a collection</span>
<span class="lnr"> 1050 </span><span class="Comment">    // 获取或者设置集合的值的多功能方法</span>
<span class="lnr"> 1051 </span><span class="Comment">    // The value/s can optionally be executed if it's a function</span>
<span class="lnr"> 1052 </span><span class="Comment">    // 如果值是一个函数,则其可以被任意执行</span>
<span class="lnr"> 1053 </span>    <span class="Statement">access</span>: <span class="Identifier">function</span>( elems, fn, key, value, chainable, emptyGet, pass ) {
<span class="lnr"> 1054 </span>       <span class="Type">var</span> exec,
<span class="lnr"> 1055 </span>          bulk = key == <span class="Type">null</span>,
<span class="lnr"> 1056 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 1057 </span>          length = elems.length;
<span class="lnr"> 1058 </span>
<span class="lnr"> 1059 </span><span class="Comment">       // Sets many values</span>
<span class="lnr"> 1060 </span><span class="Comment">       // 设置多个值,如果key为对象,遍历对象key内的属性值,然后调用access方法</span>
<span class="lnr"> 1061 </span>       <span class="Statement">if</span> ( key &amp;&amp; <span class="Statement">typeof</span> key === <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 1062 </span>          <span class="Statement">for</span> ( i <span class="Statement">in</span> key ) {
<span class="lnr"> 1063 </span>             jQuery.access( elems, fn, i, key[i], <span class="Constant">1</span>, emptyGet, value );
<span class="lnr"> 1064 </span>          }
<span class="lnr"> 1065 </span>          chainable = <span class="Constant">1</span>;
<span class="lnr"> 1066 </span>
<span class="lnr"> 1067 </span><span class="Comment">       // Sets one value</span>
<span class="lnr"> 1068 </span><span class="Comment">       // 设置单个值</span>
<span class="lnr"> 1069 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( value !== <span class="Type">undefined</span> ) {
<span class="lnr"> 1070 </span><span class="Comment">          // Optionally, function values get executed if exec is true</span>
<span class="lnr"> 1071 </span><span class="Comment">          // 如果exec为true,为函数的值会被执行</span>
<span class="lnr"> 1072 </span>          exec = pass === <span class="Type">undefined</span> &amp;&amp; jQuery.isFunction( value );
<span class="lnr"> 1073 </span>
<span class="lnr"> 1074 </span>          <span class="Statement">if</span> ( bulk ) {
<span class="lnr"> 1075 </span><span class="Comment">             // Bulk operations only iterate when executing function values</span>
<span class="lnr"> 1076 </span><span class="Comment">             // Bulk只在执行值为函数的情况下使用</span>
<span class="lnr"> 1077 </span>             <span class="Statement">if</span> ( exec ) {
<span class="lnr"> 1078 </span>                exec = fn;
<span class="lnr"> 1079 </span>                fn = <span class="Identifier">function</span>( elem, key, value ) {
<span class="lnr"> 1080 </span>                   <span class="Statement">return</span> exec.call( jQuery( elem ), value );
<span class="lnr"> 1081 </span>                };
<span class="lnr"> 1082 </span>
<span class="lnr"> 1083 </span><span class="Comment">             // Otherwise they run against the entire set</span>
<span class="lnr"> 1084 </span><span class="Comment">             // 调用fn,传入整个集合</span>
<span class="lnr"> 1085 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 1086 </span>                fn.call( elems, value );
<span class="lnr"> 1087 </span>                fn = <span class="Type">null</span>;
<span class="lnr"> 1088 </span>             }
<span class="lnr"> 1089 </span>          }
<span class="lnr"> 1090 </span>
<span class="lnr"> 1091 </span><span class="Comment">          // 如果fn不为空,执行函数</span>
<span class="lnr"> 1092 </span>          <span class="Statement">if</span> ( fn ) {
<span class="lnr"> 1093 </span>             <span class="Statement">for</span> (; i &lt; length; i++ ) {
<span class="lnr"> 1094 </span>                fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
<span class="lnr"> 1095 </span>             }
<span class="lnr"> 1096 </span>          }
<span class="lnr"> 1097 </span>
<span class="lnr"> 1098 </span>          chainable = <span class="Constant">1</span>;
<span class="lnr"> 1099 </span>       }
<span class="lnr"> 1100 </span>
<span class="lnr"> 1101 </span>       <span class="Statement">return</span> chainable ?
<span class="lnr"> 1102 </span>          <span class="Statement">elems</span> :
<span class="lnr"> 1103 </span>
<span class="lnr"> 1104 </span><span class="Comment">          // Gets</span>
<span class="lnr"> 1105 </span>          bulk ?
<span class="lnr"> 1106 </span>             fn.call( elems ) :
<span class="lnr"> 1107 </span>             length ? fn( elems[<span class="Constant">0</span>], key ) : emptyGet;
<span class="lnr"> 1108 </span>    },
<span class="lnr"> 1109 </span>
<span class="lnr"> 1110 </span><span class="Comment">    // 返回当前日期</span>
<span class="lnr"> 1111 </span>    <span class="Statement">now</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1112 </span>       <span class="Statement">return</span> ( <span class="Statement">new</span> <span class="Special">Date</span>() ).getTime();
<span class="lnr"> 1113 </span>    }
<span class="lnr"> 1114 </span>});
<span class="lnr"> 1115 </span>
<span class="lnr"> 1116 </span><span class="Comment">/*</span>
<span class="lnr"> 1117 </span><span class="Comment"> * 在DOM加载完成调用事件的机制,通过Deferred对象实现</span>
<span class="lnr"> 1118 </span><span class="Comment"> */</span>
<span class="lnr"> 1119 </span>jQuery.ready.promise = <span class="Identifier">function</span>( obj ) {
<span class="lnr"> 1120 </span>    <span class="Statement">if</span> ( !readyList ) {
<span class="lnr"> 1121 </span>
<span class="lnr"> 1122 </span>       readyList = jQuery.Deferred();
<span class="lnr"> 1123 </span>
<span class="lnr"> 1124 </span><span class="Comment">       // Catch cases where $(document).ready() is called after the browser event has already occurred.</span>
<span class="lnr"> 1125 </span><span class="Comment">       // 处理$(document).ready()在浏览器事件已经出现后才调用的情况</span>
<span class="lnr"> 1126 </span><span class="Comment">       // we once tried to use readyState &quot;interactive&quot; here, but it caused issues like the one</span>
<span class="lnr"> 1127 </span><span class="Comment">       // 我们试过使用readyState &quot;interactive&quot;,但是发现一个问题,见url:</span>
<span class="lnr"> 1128 </span><span class="Comment">       // discovered by ChrisS here: <a href="http://bugs.jquery.com/ticket/12282#comment:15">http://bugs.jquery.com/ticket/12282#comment:15</a></span>
<span class="lnr"> 1129 </span>       <span class="Statement">if</span> ( document.readyState === <span class="Constant">&quot;complete&quot;</span> ) {
<span class="lnr"> 1130 </span><span class="Comment">          // Handle it asynchronously to allow scripts the opportunity to delay ready</span>
<span class="lnr"> 1131 </span><span class="Comment">          // 异步处理,给脚本提供延迟ready的机会</span>
<span class="lnr"> 1132 </span>          setTimeout( jQuery.ready, <span class="Constant">1</span> );
<span class="lnr"> 1133 </span>
<span class="lnr"> 1134 </span><span class="Comment">       // Standards-based browsers support DOMContentLoaded</span>
<span class="lnr"> 1135 </span><span class="Comment">       // 符合标准的浏览器支持DOMContentLoaded</span>
<span class="lnr"> 1136 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( document.addEventListener ) {
<span class="lnr"> 1137 </span><span class="Comment">          // Use the handy event callback</span>
<span class="lnr"> 1138 </span><span class="Comment">          // 使用事件回调分发</span>
<span class="lnr"> 1139 </span>          document.addEventListener( <span class="Constant">&quot;DOMContentLoaded&quot;</span>, DOMContentLoaded, <span class="Constant">false</span> );
<span class="lnr"> 1140 </span>
<span class="lnr"> 1141 </span><span class="Comment">          // A fallback to window.onload, that will always work</span>
<span class="lnr"> 1142 </span><span class="Comment">          // 在window对象添加onload,肯定会起作用</span>
<span class="lnr"> 1143 </span>          window.addEventListener( <span class="Constant">&quot;load&quot;</span>, jQuery.ready, <span class="Constant">false</span> );
<span class="lnr"> 1144 </span>
<span class="lnr"> 1145 </span><span class="Comment">       // If IE event model is used</span>
<span class="lnr"> 1146 </span><span class="Comment">       // 如果使用IE事件模型</span>
<span class="lnr"> 1147 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 1148 </span><span class="Comment">          // Ensure firing before onload, maybe late but safe also for iframes</span>
<span class="lnr"> 1149 </span><span class="Comment">          // 确信在onload事件之前调用,或许会有延迟,但是对iframes也是安全的</span>
<span class="lnr"> 1150 </span>          document.attachEvent( <span class="Constant">&quot;onreadystatechange&quot;</span>, DOMContentLoaded );
<span class="lnr"> 1151 </span>
<span class="lnr"> 1152 </span><span class="Comment">          // A fallback to window.onload, that will always work</span>
<span class="lnr"> 1153 </span><span class="Comment">          // 在window对象添加onload,肯定会起作用</span>
<span class="lnr"> 1154 </span>          window.attachEvent( <span class="Constant">&quot;onload&quot;</span>, jQuery.ready );
<span class="lnr"> 1155 </span>
<span class="lnr"> 1156 </span><span class="Comment">          // If IE and not a frame</span>
<span class="lnr"> 1157 </span><span class="Comment">          // 如果是IE并且不是一个frame</span>
<span class="lnr"> 1158 </span><span class="Comment">          // continually check to see if the document is ready</span>
<span class="lnr"> 1159 </span><span class="Comment">          // 继续检查文档是否已经准备完成</span>
<span class="lnr"> 1160 </span>          <span class="Type">var</span> top = <span class="Constant">false</span>;
<span class="lnr"> 1161 </span>
<span class="lnr"> 1162 </span>          <span class="Statement">try</span> {
<span class="lnr"> 1163 </span><span class="Comment">             // 顶层的frame是否已经初始化完成,dom树是否构造完成</span>
<span class="lnr"> 1164 </span>             top = window.frameElement == <span class="Type">null</span> &amp;&amp; document.documentElement;
<span class="lnr"> 1165 </span>          } <span class="Statement">catch</span>(e) {}
<span class="lnr"> 1166 </span>
<span class="lnr"> 1167 </span>          <span class="Statement">if</span> ( top &amp;&amp; top.doScroll ) {
<span class="lnr"> 1168 </span>             (<span class="Identifier">function</span> doScrollCheck() {
<span class="lnr"> 1169 </span>                <span class="Statement">if</span> ( !jQuery.isReady ) {
<span class="lnr"> 1170 </span>
<span class="lnr"> 1171 </span>                   <span class="Statement">try</span> {
<span class="lnr"> 1172 </span><span class="Comment">                      // Use the trick by Diego Perini</span>
<span class="lnr"> 1173 </span><span class="Comment">                      // <a href="http://javascript.nwbox.com/IEContentLoaded/">http://javascript.nwbox.com/IEContentLoaded/</a></span>
<span class="lnr"> 1174 </span>                      top.doScroll(<span class="Constant">&quot;left&quot;</span>);
<span class="lnr"> 1175 </span>                   } <span class="Statement">catch</span>(e) {
<span class="lnr"> 1176 </span>                      <span class="Statement">return</span> setTimeout( doScrollCheck, <span class="Constant">50</span> );
<span class="lnr"> 1177 </span>                   }
<span class="lnr"> 1178 </span>
<span class="lnr"> 1179 </span><span class="Comment">                   // and execute any waiting functions</span>
<span class="lnr"> 1180 </span><span class="Comment">                   // 执行任何等待的函数</span>
<span class="lnr"> 1181 </span>                   jQuery.ready();
<span class="lnr"> 1182 </span>                }
<span class="lnr"> 1183 </span>             })();
<span class="lnr"> 1184 </span>          }
<span class="lnr"> 1185 </span>       }
<span class="lnr"> 1186 </span>    }
<span class="lnr"> 1187 </span>    <span class="Statement">return</span> readyList.promise( obj );
<span class="lnr"> 1188 </span>};
<span class="lnr"> 1189 </span>
<span class="lnr"> 1190 </span><span class="Comment">// Populate the class2type map</span>
<span class="lnr"> 1191 </span><span class="Comment">// 建立class2type的map,存放对象类型</span>
<span class="lnr"> 1192 </span>jQuery.each(<span class="Constant">&quot;Boolean Number String Function Array Date RegExp Object&quot;</span>.split(<span class="Constant">&quot; &quot;</span>), <span class="Identifier">function</span>(i, name) {
<span class="lnr"> 1193 </span>    class2type[ <span class="Constant">&quot;[object &quot;</span> + name + <span class="Constant">&quot;]&quot;</span> ] = name.toLowerCase();
<span class="lnr"> 1194 </span>});
<span class="lnr"> 1195 </span>
<span class="lnr"> 1196 </span><span class="Comment">// All jQuery objects should point back to these</span>
<span class="lnr"> 1197 </span><span class="Comment">// 所有jQuery对象必须指向rootjQuery</span>
<span class="lnr"> 1198 </span>rootjQuery = jQuery(document);
<span class="lnr"> 1199 </span><span class="Comment">// String to Object options format cache</span>
<span class="lnr"> 1200 </span><span class="Comment">// 缓存对象格式的选项</span>
<span class="lnr"> 1201 </span><span class="Type">var</span> optionsCache = {};
<span class="lnr"> 1202 </span>
<span class="lnr"> 1203 </span><span class="Comment">// Convert String-formatted options into Object-formatted ones and store in cache</span>
<span class="lnr"> 1204 </span><span class="Comment">// 把字符串格式的选项转换到对象格式,然后存储在cache中</span>
<span class="lnr"> 1205 </span><span class="Identifier">function</span> createOptions( options ) {
<span class="lnr"> 1206 </span><span class="Comment">    // 初始化</span>
<span class="lnr"> 1207 </span>    <span class="Type">var</span> object = optionsCache[ options ] = {};
<span class="lnr"> 1208 </span><span class="Comment">    // 使用空白字符分割,然后通过each方法在空白对象上设置属性</span>
<span class="lnr"> 1209 </span>    jQuery.each( options.split( core_rspace ), <span class="Identifier">function</span>( _, flag ) {
<span class="lnr"> 1210 </span>       object[ flag ] = <span class="Constant">true</span>;
<span class="lnr"> 1211 </span>    });
<span class="lnr"> 1212 </span>    <span class="Statement">return</span> object;
<span class="lnr"> 1213 </span>}
<span class="lnr"> 1214 </span>
<span class="lnr"> 1215 </span><span class="Comment">/*</span>
<span class="lnr"> 1216 </span><span class="Comment"> * Create a callback list using the following parameters:</span>
<span class="lnr"> 1217 </span><span class="Comment"> * 利用下列参数构造一个回调列表</span>
<span class="lnr"> 1218 </span><span class="Comment"> *</span>
<span class="lnr"> 1219 </span><span class="Comment"> *  options: an optional list of space-separated options that will change how</span>
<span class="lnr"> 1220 </span><span class="Comment"> *      the callback list behaves or a more traditional option object</span>
<span class="lnr"> 1221 </span><span class="Comment"> *          一个可选的使用空白字符分割的选项列表,会改变回调函数列表的行为</span>
<span class="lnr"> 1222 </span><span class="Comment"> *          也可以使用传统的选项对象</span>
<span class="lnr"> 1223 </span><span class="Comment"> *</span>
<span class="lnr"> 1224 </span><span class="Comment"> * By default a callback list will act like an event callback list and can be</span>
<span class="lnr"> 1225 </span><span class="Comment"> * &quot;fired&quot; multiple times.</span>
<span class="lnr"> 1226 </span><span class="Comment"> * 默认情况下,一个回调函数列表会表现的像一个事件回调列表,可以被触发多次</span>
<span class="lnr"> 1227 </span><span class="Comment"> *</span>
<span class="lnr"> 1228 </span><span class="Comment"> * Possible options:</span>
<span class="lnr"> 1229 </span><span class="Comment"> * 可能的选项</span>
<span class="lnr"> 1230 </span><span class="Comment"> *</span>
<span class="lnr"> 1231 </span><span class="Comment"> *  once:        will ensure the callback list can only be fired once (like a Deferred)</span>
<span class="lnr"> 1232 </span><span class="Comment"> *            回调列表只会被执行一次(像一个Deferred)</span>
<span class="lnr"> 1233 </span><span class="Comment"> *</span>
<span class="lnr"> 1234 </span><span class="Comment"> *  memory:        will keep track of previous values and will call any callback added</span>
<span class="lnr"> 1235 </span><span class="Comment"> *            after the list has been fired right away with the latest &quot;memorized&quot;</span>
<span class="lnr"> 1236 </span><span class="Comment"> *            values (like a Deferred)</span>
<span class="lnr"> 1237 </span><span class="Comment"> *            追踪前面产生的值,而且会正确调用任何在list被触发后加入到list中的回调</span>
<span class="lnr"> 1238 </span><span class="Comment"> *</span>
<span class="lnr"> 1239 </span><span class="Comment"> *  unique:        will ensure a callback can only be added once (no duplicate in the list)</span>
<span class="lnr"> 1240 </span><span class="Comment"> *            保证一个回调函数只会被加入一次(列表中的回调不会被同名回调覆盖)</span>
<span class="lnr"> 1241 </span><span class="Comment"> *</span>
<span class="lnr"> 1242 </span><span class="Comment"> *  stopOnFalse:    interrupt callings when a callback returns false</span>
<span class="lnr"> 1243 </span><span class="Comment"> *            如果回调函数中的一个返回false,则终止回调函数的执行</span>
<span class="lnr"> 1244 </span><span class="Comment"> *</span>
<span class="lnr"> 1245 </span><span class="Comment"> */</span>
<span class="lnr"> 1246 </span>jQuery.Callbacks = <span class="Identifier">function</span>( options ) {
<span class="lnr"> 1247 </span>
<span class="lnr"> 1248 </span><span class="Comment">    // Convert options from String-formatted to Object-formatted if needed</span>
<span class="lnr"> 1249 </span><span class="Comment">    // (we check in cache first)</span>
<span class="lnr"> 1250 </span><span class="Comment">    // 先处理选项字符串,转换为对象格式,处理前先检查cache中存在不存在</span>
<span class="lnr"> 1251 </span>    options = <span class="Statement">typeof</span> options === <span class="Constant">&quot;string&quot;</span> ?
<span class="lnr"> 1252 </span>       ( optionsCache[ options ] || createOptions( options ) ) :
<span class="lnr"> 1253 </span>       jQuery.extend( {}, options );
<span class="lnr"> 1254 </span>
<span class="lnr"> 1255 </span>    <span class="Type">var</span> <span class="Comment">// Last fire value (for non-forgettable lists)</span>
<span class="lnr"> 1256 </span><span class="Comment">       // 上一次触发的值 (for non-forgettable lists)</span>
<span class="lnr"> 1257 </span>       memory,
<span class="lnr"> 1258 </span><span class="Comment">       // Flag to know if list was already fired</span>
<span class="lnr"> 1259 </span><span class="Comment">       // list是否已经触发的标志</span>
<span class="lnr"> 1260 </span>       fired,
<span class="lnr"> 1261 </span><span class="Comment">       // Flag to know if list is currently firing</span>
<span class="lnr"> 1262 </span><span class="Comment">       // list是否正在触发</span>
<span class="lnr"> 1263 </span>       firing,
<span class="lnr"> 1264 </span><span class="Comment">       // First callback to fire (used internally by add and fireWith)</span>
<span class="lnr"> 1265 </span><span class="Comment">       // 第一个要触发的回调（为内部的add和fireWith提供）</span>
<span class="lnr"> 1266 </span>       firingStart,
<span class="lnr"> 1267 </span><span class="Comment">       // End of the loop when firing</span>
<span class="lnr"> 1268 </span><span class="Comment">       // 循环的终点</span>
<span class="lnr"> 1269 </span>       firingLength,
<span class="lnr"> 1270 </span><span class="Comment">       // Index of currently firing callback (modified by remove if needed)</span>
<span class="lnr"> 1271 </span><span class="Comment">       // 当前触发的回调的序号</span>
<span class="lnr"> 1272 </span>       firingIndex,
<span class="lnr"> 1273 </span><span class="Comment">       // Actual callback list</span>
<span class="lnr"> 1274 </span><span class="Comment">       // 真正的回调列表</span>
<span class="lnr"> 1275 </span>       list = [],
<span class="lnr"> 1276 </span><span class="Comment">       // Stack of fire calls for repeatable lists</span>
<span class="lnr"> 1277 </span><span class="Comment">       // 可重复触发列表的栈</span>
<span class="lnr"> 1278 </span>       stack = !options.once &amp;&amp; [],
<span class="lnr"> 1279 </span><span class="Comment">       // Fire callbacks</span>
<span class="lnr"> 1280 </span><span class="Comment">       // 触发回调</span>
<span class="lnr"> 1281 </span>       fire = <span class="Identifier">function</span>( data ) {
<span class="lnr"> 1282 </span>          memory = options.memory &amp;&amp; data;
<span class="lnr"> 1283 </span>          fired = <span class="Constant">true</span>;
<span class="lnr"> 1284 </span>          firingIndex = firingStart || <span class="Constant">0</span>;
<span class="lnr"> 1285 </span>          firingStart = <span class="Constant">0</span>;
<span class="lnr"> 1286 </span>          firingLength = list.length;
<span class="lnr"> 1287 </span>          firing = <span class="Constant">true</span>;
<span class="lnr"> 1288 </span>          <span class="Statement">for</span> ( ; list &amp;&amp; firingIndex &lt; firingLength; firingIndex++ ) {
<span class="lnr"> 1289 </span>             <span class="Statement">if</span> ( list[ firingIndex ].apply( data[ <span class="Constant">0</span> ], data[ <span class="Constant">1</span> ] ) === <span class="Constant">false</span> &amp;&amp; options.stopOnFalse ) {
<span class="lnr"> 1290 </span><span class="Comment">                // To prevent further calls using add </span>
<span class="lnr"> 1291 </span><span class="Comment">                // 防止使用add方法添加的调用</span>
<span class="lnr"> 1292 </span>                memory = <span class="Constant">false</span>;
<span class="lnr"> 1293 </span>                <span class="Statement">break</span>;
<span class="lnr"> 1294 </span>             }
<span class="lnr"> 1295 </span>          }
<span class="lnr"> 1296 </span>          firing = <span class="Constant">false</span>;
<span class="lnr"> 1297 </span>          <span class="Statement">if</span> ( list ) {
<span class="lnr"> 1298 </span>             <span class="Statement">if</span> ( stack ) {
<span class="lnr"> 1299 </span>                <span class="Statement">if</span> ( stack.length ) {
<span class="lnr"> 1300 </span>                   fire( stack.shift() );
<span class="lnr"> 1301 </span>                }
<span class="lnr"> 1302 </span>             } <span class="Statement">else</span> <span class="Statement">if</span> ( memory ) {
<span class="lnr"> 1303 </span>                list = [];
<span class="lnr"> 1304 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 1305 </span>                self.disable();
<span class="lnr"> 1306 </span>             }
<span class="lnr"> 1307 </span>          }
<span class="lnr"> 1308 </span>       },
<span class="lnr"> 1309 </span><span class="Comment">       // Actual Callbacks object</span>
<span class="lnr"> 1310 </span><span class="Comment">       // 实际的callback对象</span>
<span class="lnr"> 1311 </span>       self = {
<span class="lnr"> 1312 </span><span class="Comment">          // Add a callback or a collection of callbacks to the list</span>
<span class="lnr"> 1313 </span><span class="Comment">          // 增加回调函数</span>
<span class="lnr"> 1314 </span>          <span class="Statement">add</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1315 </span>             <span class="Statement">if</span> ( list ) {
<span class="lnr"> 1316 </span><span class="Comment">                // First, we save the current length</span>
<span class="lnr"> 1317 </span>                <span class="Type">var</span> start = list.length;
<span class="lnr"> 1318 </span><span class="Comment">                // 匿名函数</span>
<span class="lnr"> 1319 </span>                (<span class="Identifier">function</span> add( args ) {
<span class="lnr"> 1320 </span>                   jQuery.each( args, <span class="Identifier">function</span>( _, arg ) {
<span class="lnr"> 1321 </span>                      <span class="Type">var</span> type = jQuery.type( arg );
<span class="lnr"> 1322 </span>                      <span class="Statement">if</span> ( type === <span class="Constant">&quot;function&quot;</span> &amp;&amp; ( !options.unique || !self.has( arg ) ) ) {
<span class="lnr"> 1323 </span>                         list.push( arg );
<span class="lnr"> 1324 </span>                      } <span class="Statement">else</span> <span class="Statement">if</span> ( arg &amp;&amp; arg.length &amp;&amp; type !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 1325 </span><span class="Comment">                         // Inspect recursively</span>
<span class="lnr"> 1326 </span><span class="Comment">                         // 递归检查</span>
<span class="lnr"> 1327 </span>                         add( arg );
<span class="lnr"> 1328 </span>                      }
<span class="lnr"> 1329 </span>                   });
<span class="lnr"> 1330 </span>                })( arguments );
<span class="lnr"> 1331 </span><span class="Comment">                // Do we need to add the callbacks to the</span>
<span class="lnr"> 1332 </span><span class="Comment">                // current firing batch?</span>
<span class="lnr"> 1333 </span><span class="Comment">                // 是否需要对正在触发的列表中增加函数？</span>
<span class="lnr"> 1334 </span>                <span class="Statement">if</span> ( firing ) {
<span class="lnr"> 1335 </span>                   firingLength = list.length;
<span class="lnr"> 1336 </span><span class="Comment">                // With memory, if we're not firing then</span>
<span class="lnr"> 1337 </span><span class="Comment">                // we should call right away</span>
<span class="lnr"> 1338 </span><span class="Comment">                // 如果有memory,如果没有在触发队列,那么需要正确触发</span>
<span class="lnr"> 1339 </span>                } <span class="Statement">else</span> <span class="Statement">if</span> ( memory ) {
<span class="lnr"> 1340 </span>                   firingStart = start;
<span class="lnr"> 1341 </span>                   fire( memory );
<span class="lnr"> 1342 </span>                }
<span class="lnr"> 1343 </span>             }
<span class="lnr"> 1344 </span>             <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 1345 </span>          },
<span class="lnr"> 1346 </span><span class="Comment">          // Remove a callback from the list</span>
<span class="lnr"> 1347 </span><span class="Comment">          // 从队列中移除一个回调</span>
<span class="lnr"> 1348 </span>          <span class="Statement">remove</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1349 </span>             <span class="Statement">if</span> ( list ) {
<span class="lnr"> 1350 </span>                jQuery.each( arguments, <span class="Identifier">function</span>( _, arg ) {
<span class="lnr"> 1351 </span>                   <span class="Type">var</span> index;
<span class="lnr"> 1352 </span>                   <span class="Statement">while</span>( ( index = jQuery.inArray( arg, list, index ) ) &gt; -<span class="Constant">1</span> ) {
<span class="lnr"> 1353 </span>                      list.splice( index, <span class="Constant">1</span> );
<span class="lnr"> 1354 </span><span class="Comment">                      // Handle firing indexes</span>
<span class="lnr"> 1355 </span><span class="Comment">                      // 处理正在触发的索引号</span>
<span class="lnr"> 1356 </span>                      <span class="Statement">if</span> ( firing ) {
<span class="lnr"> 1357 </span>                         <span class="Statement">if</span> ( index &lt;= firingLength ) {
<span class="lnr"> 1358 </span>                            firingLength--;
<span class="lnr"> 1359 </span>                         }
<span class="lnr"> 1360 </span>                         <span class="Statement">if</span> ( index &lt;= firingIndex ) {
<span class="lnr"> 1361 </span>                            firingIndex--;
<span class="lnr"> 1362 </span>                         }
<span class="lnr"> 1363 </span>                      }
<span class="lnr"> 1364 </span>                   }
<span class="lnr"> 1365 </span>                });
<span class="lnr"> 1366 </span>             }
<span class="lnr"> 1367 </span>             <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 1368 </span>          },
<span class="lnr"> 1369 </span><span class="Comment">          // Control if a given callback is in the list</span>
<span class="lnr"> 1370 </span><span class="Comment">          // 控制传入的回调是否在队列中</span>
<span class="lnr"> 1371 </span>          <span class="Statement">has</span>: <span class="Identifier">function</span>( fn ) {
<span class="lnr"> 1372 </span>             <span class="Statement">return</span> jQuery.inArray( fn, list ) &gt; -<span class="Constant">1</span>;
<span class="lnr"> 1373 </span>          },
<span class="lnr"> 1374 </span><span class="Comment">          // Remove all callbacks from the list</span>
<span class="lnr"> 1375 </span><span class="Comment">          // 情况异步队列</span>
<span class="lnr"> 1376 </span>          <span class="Statement">empty</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1377 </span>             list = [];
<span class="lnr"> 1378 </span>             <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 1379 </span>          },
<span class="lnr"> 1380 </span><span class="Comment">          // Have the list do nothing anymore</span>
<span class="lnr"> 1381 </span><span class="Comment">          // 队列置为无效</span>
<span class="lnr"> 1382 </span>          <span class="Statement">disable</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1383 </span>             list = stack = memory = <span class="Type">undefined</span>;
<span class="lnr"> 1384 </span>             <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 1385 </span>          },
<span class="lnr"> 1386 </span><span class="Comment">          // Is it disabled?</span>
<span class="lnr"> 1387 </span><span class="Comment">          // 判断队列是否有效</span>
<span class="lnr"> 1388 </span>          <span class="Statement">disabled</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1389 </span>             <span class="Statement">return</span> !list;
<span class="lnr"> 1390 </span>          },
<span class="lnr"> 1391 </span><span class="Comment">          // Lock the list in its current state</span>
<span class="lnr"> 1392 </span><span class="Comment">          // 锁定队列在当前状态上</span>
<span class="lnr"> 1393 </span>          <span class="Statement">lock</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1394 </span>             stack = <span class="Type">undefined</span>;
<span class="lnr"> 1395 </span>             <span class="Statement">if</span> ( !memory ) {
<span class="lnr"> 1396 </span>                self.disable();
<span class="lnr"> 1397 </span>             }
<span class="lnr"> 1398 </span>             <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 1399 </span>          },
<span class="lnr"> 1400 </span><span class="Comment">          // Is it locked?</span>
<span class="lnr"> 1401 </span><span class="Comment">          // 判断队列是否锁定</span>
<span class="lnr"> 1402 </span>          <span class="Statement">locked</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1403 </span>             <span class="Statement">return</span> !stack;
<span class="lnr"> 1404 </span>          },
<span class="lnr"> 1405 </span><span class="Comment">          // Call all callbacks with the given context and arguments</span>
<span class="lnr"> 1406 </span><span class="Comment">          // 在传入的上下文和参数上调用所有回调</span>
<span class="lnr"> 1407 </span>          <span class="Statement">fireWith</span>: <span class="Identifier">function</span>( context, args ) {
<span class="lnr"> 1408 </span>             args = args || [];
<span class="lnr"> 1409 </span>             args = [ context, args.slice ? args.slice() : args ];
<span class="lnr"> 1410 </span>             <span class="Statement">if</span> ( list &amp;&amp; ( !fired || stack ) ) {
<span class="lnr"> 1411 </span>                <span class="Statement">if</span> ( firing ) {
<span class="lnr"> 1412 </span>                   stack.push( args );
<span class="lnr"> 1413 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 1414 </span>                   fire( args );
<span class="lnr"> 1415 </span>                }
<span class="lnr"> 1416 </span>             }
<span class="lnr"> 1417 </span>             <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 1418 </span>          },
<span class="lnr"> 1419 </span><span class="Comment">          // Call all the callbacks with the given arguments</span>
<span class="lnr"> 1420 </span><span class="Comment">          // 根据参数调用所有回调函数</span>
<span class="lnr"> 1421 </span>          <span class="Statement">fire</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1422 </span>             self.fireWith( <span class="Type">this</span>, arguments );
<span class="lnr"> 1423 </span>             <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 1424 </span>          },
<span class="lnr"> 1425 </span><span class="Comment">          // To know if the callbacks have already been called at least once</span>
<span class="lnr"> 1426 </span><span class="Comment">          // 判断回调函数是否被调用了至少一次</span>
<span class="lnr"> 1427 </span>          <span class="Statement">fired</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1428 </span>             <span class="Statement">return</span> !!fired;
<span class="lnr"> 1429 </span>          }
<span class="lnr"> 1430 </span>       };
<span class="lnr"> 1431 </span>
<span class="lnr"> 1432 </span>    <span class="Statement">return</span> self;
<span class="lnr"> 1433 </span>};
<span class="lnr"> 1434 </span>jQuery.extend({
<span class="lnr"> 1435 </span>
<span class="lnr"> 1436 </span>    <span class="Comment">/*</span>
<span class="lnr"> 1437 </span><span class="Comment">     * 异步队列</span>
<span class="lnr"> 1438 </span><span class="Comment">     * 方法通过jQuery.Callbacks进行包装和维护</span>
<span class="lnr"> 1439 </span><span class="Comment">     */</span>
<span class="lnr"> 1440 </span>    <span class="Statement">Deferred</span>: <span class="Identifier">function</span>( func ) {
<span class="lnr"> 1441 </span>       <span class="Type">var</span> tuples = [
<span class="lnr"> 1442 </span><span class="Comment">             // action, add listener, listener list, final state</span>
<span class="lnr"> 1443 </span>             [ <span class="Constant">&quot;resolve&quot;</span>, <span class="Constant">&quot;done&quot;</span>, jQuery.Callbacks(<span class="Constant">&quot;once memory&quot;</span>), <span class="Constant">&quot;resolved&quot;</span> ],
<span class="lnr"> 1444 </span>             [ <span class="Constant">&quot;reject&quot;</span>, <span class="Constant">&quot;fail&quot;</span>, jQuery.Callbacks(<span class="Constant">&quot;once memory&quot;</span>), <span class="Constant">&quot;rejected&quot;</span> ],
<span class="lnr"> 1445 </span>             [ <span class="Constant">&quot;notify&quot;</span>, <span class="Constant">&quot;progress&quot;</span>, jQuery.Callbacks(<span class="Constant">&quot;memory&quot;</span>) ]
<span class="lnr"> 1446 </span>          ],
<span class="lnr"> 1447 </span><span class="Comment">          // 状态设置为“即将发生的”</span>
<span class="lnr"> 1448 </span>          state = <span class="Constant">&quot;pending&quot;</span>,
<span class="lnr"> 1449 </span>          promise = {
<span class="lnr"> 1450 </span><span class="Comment">             // 返回状态</span>
<span class="lnr"> 1451 </span>             <span class="Statement">state</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1452 </span>                <span class="Statement">return</span> state;
<span class="lnr"> 1453 </span>             },
<span class="lnr"> 1454 </span><span class="Comment">             // 无论成功或者失败都调用</span>
<span class="lnr"> 1455 </span>             <span class="Statement">always</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 1456 </span>                deferred.done( arguments ).fail( arguments );
<span class="lnr"> 1457 </span>                <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 1458 </span>             },
<span class="lnr"> 1459 </span><span class="Comment">             // 便捷方法,同时传入成功、失败、通知的回调函数</span>
<span class="lnr"> 1460 </span>             <span class="Statement">then</span>: <span class="Identifier">function</span>( <span class="Comment">/* fnDone, fnFail, fnProgress */</span> ) {
<span class="lnr"> 1461 </span><span class="Comment">                // 从arguments中获取状态对应的处理函数</span>
<span class="lnr"> 1462 </span>                <span class="Type">var</span> fns = arguments;
<span class="lnr"> 1463 </span>                <span class="Statement">return</span> jQuery.Deferred(<span class="Identifier">function</span>( newDefer ) {
<span class="lnr"> 1464 </span><span class="Comment">                   // each() 方法用来让DOM循环结构更简单更不易出错.它会迭代jQuery对象中的每一个DOM元素.</span>
<span class="lnr"> 1465 </span><span class="Comment">                   // 每次回调函数执行时,会传递当前循环次数作为参数(从0开始计数).</span>
<span class="lnr"> 1466 </span><span class="Comment">                   // 回调函数是在当前DOM元素为上下文的语境中触发的.因此关键字 this 总是指向这个元素.</span>
<span class="lnr"> 1467 </span><span class="Comment">                   // .each( function(index, Element) )</span>
<span class="lnr"> 1468 </span>                   jQuery.each( tuples, <span class="Identifier">function</span>( i, tuple ) {
<span class="lnr"> 1469 </span><span class="Comment">                      // i为遍历的索引号,tuple为遍历到的元素,tuple[ 0 ]为&quot;resolve&quot;、&quot;reject&quot;、&quot;notify&quot;.</span>
<span class="lnr"> 1470 </span>                      <span class="Type">var</span> action = tuple[ <span class="Constant">0</span> ],
<span class="lnr"> 1471 </span><span class="Comment">                         // fn为对应的处理函数</span>
<span class="lnr"> 1472 </span>                         fn = fns[ i ];
<span class="lnr"> 1473 </span><span class="Comment">                      // deferred[ done | fail | progress ] for forwarding actions to newDefer</span>
<span class="lnr"> 1474 </span><span class="Comment">                      // 通过jQuery.Callbacks里的函数进行包装</span>
<span class="lnr"> 1475 </span>                      deferred[ tuple[<span class="Constant">1</span>] ]( jQuery.isFunction( fn ) ?
<span class="lnr"> 1476 </span>                         <span class="Identifier">function</span>() {
<span class="lnr"> 1477 </span><span class="Comment">                            // returned为传入的函数的返回值,如果then中传入的函数的返回值也是deferred</span>
<span class="lnr"> 1478 </span><span class="Comment">                            // 则继续通过promise()获取只读对象进行调用</span>
<span class="lnr"> 1479 </span>                            <span class="Type">var</span> returned = fn.apply( <span class="Type">this</span>, arguments );
<span class="lnr"> 1480 </span>                            <span class="Statement">if</span> ( returned &amp;&amp; jQuery.isFunction( returned.promise ) ) {
<span class="lnr"> 1481 </span>                               returned.promise()
<span class="lnr"> 1482 </span>                                  .done( newDefer.resolve )
<span class="lnr"> 1483 </span>                                  .fail( newDefer.reject )
<span class="lnr"> 1484 </span>                                  .progress( newDefer.notify );
<span class="lnr"> 1485 </span>                            } <span class="Statement">else</span> {
<span class="lnr"> 1486 </span>                               newDefer[ action + <span class="Constant">&quot;With&quot;</span> ]( <span class="Type">this</span> === deferred ? newDefer : <span class="Type">this</span>, [ returned ] );
<span class="lnr"> 1487 </span>                            }
<span class="lnr"> 1488 </span>                         } :
<span class="lnr"> 1489 </span>                         newDefer[ action ]
<span class="lnr"> 1490 </span>                      );
<span class="lnr"> 1491 </span>                   });
<span class="lnr"> 1492 </span>                   fns = <span class="Type">null</span>;
<span class="lnr"> 1493 </span>                }).promise();
<span class="lnr"> 1494 </span>             },
<span class="lnr"> 1495 </span><span class="Comment">             // Get a promise for this deferred</span>
<span class="lnr"> 1496 </span><span class="Comment">             // If obj is provided, the promise aspect is added to the object</span>
<span class="lnr"> 1497 </span><span class="Comment">             // 获取deferred对象的只读版本</span>
<span class="lnr"> 1498 </span><span class="Comment">             // 如果obj已经提供,promise被加到object中</span>
<span class="lnr"> 1499 </span>             <span class="Statement">promise</span>: <span class="Identifier">function</span>( obj ) {
<span class="lnr"> 1500 </span>                <span class="Statement">return</span> <span class="Statement">typeof</span> obj === <span class="Constant">&quot;object&quot;</span> ? jQuery.extend( obj, promise ) : promise;
<span class="lnr"> 1501 </span>             }
<span class="lnr"> 1502 </span>          },
<span class="lnr"> 1503 </span>          deferred = {};
<span class="lnr"> 1504 </span>
<span class="lnr"> 1505 </span><span class="Comment">       // Keep pipe for back-compat</span>
<span class="lnr"> 1506 </span><span class="Comment">       // 为pipe提供向后兼容性</span>
<span class="lnr"> 1507 </span>       promise.pipe = promise.then;
<span class="lnr"> 1508 </span>
<span class="lnr"> 1509 </span><span class="Comment">       // Add list-specific methods</span>
<span class="lnr"> 1510 </span><span class="Comment">       // 添加指定的方法</span>
<span class="lnr"> 1511 </span>       jQuery.each( tuples, <span class="Identifier">function</span>( i, tuple ) {
<span class="lnr"> 1512 </span><span class="Comment">          // tuple[ 2 ]是通过jQuery.Callbacks构造的异步队列</span>
<span class="lnr"> 1513 </span>          <span class="Type">var</span> list = tuple[ <span class="Constant">2</span> ],
<span class="lnr"> 1514 </span>             stateString = tuple[ <span class="Constant">3</span> ];
<span class="lnr"> 1515 </span>
<span class="lnr"> 1516 </span><span class="Comment">          // promise[ done | fail | progress ] = list.add</span>
<span class="lnr"> 1517 </span>          promise[ tuple[<span class="Constant">1</span>] ] = list.add;
<span class="lnr"> 1518 </span>
<span class="lnr"> 1519 </span><span class="Comment">          // Handle state</span>
<span class="lnr"> 1520 </span><span class="Comment">          // 处理状态</span>
<span class="lnr"> 1521 </span>          <span class="Statement">if</span> ( stateString ) {
<span class="lnr"> 1522 </span>             list.add(<span class="Identifier">function</span>() {
<span class="lnr"> 1523 </span><span class="Comment">                // state = [ resolved | rejected ]</span>
<span class="lnr"> 1524 </span>                state = stateString;
<span class="lnr"> 1525 </span>
<span class="lnr"> 1526 </span>             <span class="Comment">/* </span>
<span class="lnr"> 1527 </span><span class="Comment">              * [ reject_list | resolve_list ].disable; progress_list.lock</span>
<span class="lnr"> 1528 </span><span class="Comment">              * 位运算 XOR 由符号（^）表示,直接对二进制形式进行运算</span>
<span class="lnr"> 1529 </span><span class="Comment">              * XOR 不同于 OR,当只有一个数位存放的是 1 时,它才返回 1.真值表如下:</span>
<span class="lnr"> 1530 </span><span class="Comment">              *    --------------------+--------------------+-------</span>
<span class="lnr"> 1531 </span><span class="Comment">              *     第一个数字中的数位 | 第二个数字中的数位 | 结果</span>
<span class="lnr"> 1532 </span><span class="Comment">              *           1         |          1         |   0</span>
<span class="lnr"> 1533 </span><span class="Comment">              *           1       |         0         |   1</span>
<span class="lnr"> 1534 </span><span class="Comment">              *           0       |          1         |   1</span>
<span class="lnr"> 1535 </span><span class="Comment">              *            0       |          0         |   0</span>
<span class="lnr"> 1536 </span><span class="Comment">              *    --------------------+--------------------+-------</span>
<span class="lnr"> 1537 </span><span class="Comment">              */</span>
<span class="lnr"> 1538 </span>
<span class="lnr"> 1539 </span>             }, tuples[ i ^ <span class="Constant">1</span> ][ <span class="Constant">2</span> ].disable, tuples[ <span class="Constant">2</span> ][ <span class="Constant">2</span> ].lock );
<span class="lnr"> 1540 </span>          }
<span class="lnr"> 1541 </span>
<span class="lnr"> 1542 </span><span class="Comment">          // deferred[ resolve | reject | notify ] = list.fire</span>
<span class="lnr"> 1543 </span>          deferred[ tuple[<span class="Constant">0</span>] ] = list.fire;
<span class="lnr"> 1544 </span>          deferred[ tuple[<span class="Constant">0</span>] + <span class="Constant">&quot;With&quot;</span> ] = list.fireWith;
<span class="lnr"> 1545 </span>       });
<span class="lnr"> 1546 </span>
<span class="lnr"> 1547 </span><span class="Comment">       // Make the deferred a promise</span>
<span class="lnr"> 1548 </span><span class="Comment">       // 提供只读对象</span>
<span class="lnr"> 1549 </span>       promise.promise( deferred );
<span class="lnr"> 1550 </span>
<span class="lnr"> 1551 </span><span class="Comment">       // Call given func if any</span>
<span class="lnr"> 1552 </span><span class="Comment">       // 调用提供的方法</span>
<span class="lnr"> 1553 </span>       <span class="Statement">if</span> ( func ) {
<span class="lnr"> 1554 </span>          func.call( deferred, deferred );
<span class="lnr"> 1555 </span>       }
<span class="lnr"> 1556 </span>
<span class="lnr"> 1557 </span><span class="Comment">       // All done!</span>
<span class="lnr"> 1558 </span>       <span class="Statement">return</span> deferred;
<span class="lnr"> 1559 </span>    },
<span class="lnr"> 1560 </span>
<span class="lnr"> 1561 </span><span class="Comment">    // Deferred helper</span>
<span class="lnr"> 1562 </span><span class="Comment">    // Deffered的便捷函数</span>
<span class="lnr"> 1563 </span>    <span class="Statement">when</span>: <span class="Identifier">function</span>( subordinate <span class="Comment">/* , ..., subordinateN */</span> ) {
<span class="lnr"> 1564 </span>       <span class="Type">var</span> i = <span class="Constant">0</span>,
<span class="lnr"> 1565 </span>          resolveValues = core_slice.call( arguments ),
<span class="lnr"> 1566 </span>          length = resolveValues.length,
<span class="lnr"> 1567 </span>
<span class="lnr"> 1568 </span><span class="Comment">          // the count of uncompleted subordinates</span>
<span class="lnr"> 1569 </span><span class="Comment">          // 延迟执行的函数的数目</span>
<span class="lnr"> 1570 </span>          remaining = length !== <span class="Constant">1</span> || ( subordinate &amp;&amp; jQuery.isFunction( subordinate.promise ) ) ? length : <span class="Constant">0</span>,
<span class="lnr"> 1571 </span>
<span class="lnr"> 1572 </span><span class="Comment">          // the master Deferred. If resolveValues consist of only a single Deferred, just use that.</span>
<span class="lnr"> 1573 </span><span class="Comment">          // 主延迟对象,如果延迟执行的函数要求只有一个延迟对象,使用这个</span>
<span class="lnr"> 1574 </span>          deferred = remaining === <span class="Constant">1</span> ? subordinate : jQuery.Deferred(),
<span class="lnr"> 1575 </span>
<span class="lnr"> 1576 </span><span class="Comment">          // Update function for both resolve and progress values</span>
<span class="lnr"> 1577 </span><span class="Comment">          // 更新resolve和progress的值</span>
<span class="lnr"> 1578 </span>          updateFunc = <span class="Identifier">function</span>( i, contexts, values ) {
<span class="lnr"> 1579 </span>             <span class="Statement">return</span> <span class="Identifier">function</span>( value ) {
<span class="lnr"> 1580 </span>                contexts[ i ] = <span class="Type">this</span>;
<span class="lnr"> 1581 </span>                values[ i ] = arguments.length &gt; <span class="Constant">1</span> ? core_slice.call( arguments ) : value;
<span class="lnr"> 1582 </span>                <span class="Statement">if</span>( values === progressValues ) {
<span class="lnr"> 1583 </span>                   deferred.notifyWith( contexts, values );
<span class="lnr"> 1584 </span>                } <span class="Statement">else</span> <span class="Statement">if</span> ( !( --remaining ) ) {
<span class="lnr"> 1585 </span>                   deferred.resolveWith( contexts, values );
<span class="lnr"> 1586 </span>                }
<span class="lnr"> 1587 </span>             };
<span class="lnr"> 1588 </span>          },
<span class="lnr"> 1589 </span>
<span class="lnr"> 1590 </span>          progressValues, progressContexts, resolveContexts;
<span class="lnr"> 1591 </span>
<span class="lnr"> 1592 </span><span class="Comment">       // add listeners to Deferred subordinates; treat others as resolved</span>
<span class="lnr"> 1593 </span><span class="Comment">       // 增加监听事件</span>
<span class="lnr"> 1594 </span>       <span class="Statement">if</span> ( length &gt; <span class="Constant">1</span> ) {
<span class="lnr"> 1595 </span>          progressValues = <span class="Statement">new</span> <span class="Special">Array</span>( length );
<span class="lnr"> 1596 </span>          progressContexts = <span class="Statement">new</span> <span class="Special">Array</span>( length );
<span class="lnr"> 1597 </span>          resolveContexts = <span class="Statement">new</span> <span class="Special">Array</span>( length );
<span class="lnr"> 1598 </span>          <span class="Statement">for</span> ( ; i &lt; length; i++ ) {
<span class="lnr"> 1599 </span>             <span class="Statement">if</span> ( resolveValues[ i ] &amp;&amp; jQuery.isFunction( resolveValues[ i ].promise ) ) {
<span class="lnr"> 1600 </span>                resolveValues[ i ].promise()
<span class="lnr"> 1601 </span>                   .done( updateFunc( i, resolveContexts, resolveValues ) )
<span class="lnr"> 1602 </span>                   .fail( deferred.reject )
<span class="lnr"> 1603 </span>                   .progress( updateFunc( i, progressContexts, progressValues ) );
<span class="lnr"> 1604 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 1605 </span>                --remaining;
<span class="lnr"> 1606 </span>             }
<span class="lnr"> 1607 </span>          }
<span class="lnr"> 1608 </span>       }
<span class="lnr"> 1609 </span>
<span class="lnr"> 1610 </span><span class="Comment">       // if we're not waiting on anything, resolve the master</span>
<span class="lnr"> 1611 </span><span class="Comment">       // 如果不用延迟,直接调用resolve方法</span>
<span class="lnr"> 1612 </span>       <span class="Statement">if</span> ( !remaining ) {
<span class="lnr"> 1613 </span>          deferred.resolveWith( resolveContexts, resolveValues );
<span class="lnr"> 1614 </span>       }
<span class="lnr"> 1615 </span>
<span class="lnr"> 1616 </span>       <span class="Statement">return</span> deferred.promise();
<span class="lnr"> 1617 </span>    }
<span class="lnr"> 1618 </span>});
<span class="lnr"> 1619 </span>jQuery.support = (<span class="Identifier">function</span>() {
<span class="lnr"> 1620 </span>
<span class="lnr"> 1621 </span>    <span class="Type">var</span> support,
<span class="lnr"> 1622 </span>       all,
<span class="lnr"> 1623 </span>       a,
<span class="lnr"> 1624 </span>       select,
<span class="lnr"> 1625 </span>       opt,
<span class="lnr"> 1626 </span>       input,
<span class="lnr"> 1627 </span>       fragment,
<span class="lnr"> 1628 </span>       eventName,
<span class="lnr"> 1629 </span>       i,
<span class="lnr"> 1630 </span>       isSupported,
<span class="lnr"> 1631 </span>       clickFn,
<span class="lnr"> 1632 </span>       div = document.createElement(<span class="Constant">&quot;div&quot;</span>);
<span class="lnr"> 1633 </span>
<span class="lnr"> 1634 </span><span class="Comment">    // Preliminary tests</span>
<span class="lnr"> 1635 </span><span class="Comment">    // 进行测试</span>
<span class="lnr"> 1636 </span>    div.setAttribute( <span class="Constant">&quot;className&quot;</span>, <span class="Constant">&quot;t&quot;</span> );
<span class="lnr"> 1637 </span>    div.innerHTML = <span class="Constant">&quot;  &lt;link/&gt;&lt;table&gt;&lt;/table&gt;&lt;a href='/a'&gt;a&lt;/a&gt;&lt;input type='checkbox'/&gt;&quot;</span>;
<span class="lnr"> 1638 </span>
<span class="lnr"> 1639 </span>    all = div.getElementsByTagName(<span class="Constant">&quot;*&quot;</span>);
<span class="lnr"> 1640 </span>    a = div.getElementsByTagName(<span class="Constant">&quot;a&quot;</span>)[ <span class="Constant">0</span> ];
<span class="lnr"> 1641 </span>    a.style.cssText = <span class="Constant">&quot;top:1px;float:left;opacity:.5&quot;</span>;
<span class="lnr"> 1642 </span>
<span class="lnr"> 1643 </span><span class="Comment">    // Can't get basic test support</span>
<span class="lnr"> 1644 </span><span class="Comment">    // 无法获取测试用例</span>
<span class="lnr"> 1645 </span>    <span class="Statement">if</span> ( !all || !all.length || !a ) {
<span class="lnr"> 1646 </span>       <span class="Statement">return</span> {};
<span class="lnr"> 1647 </span>    }
<span class="lnr"> 1648 </span>
<span class="lnr"> 1649 </span><span class="Comment">    // First batch of supports tests</span>
<span class="lnr"> 1650 </span><span class="Comment">    // 支持测试</span>
<span class="lnr"> 1651 </span>    select = document.createElement(<span class="Constant">&quot;select&quot;</span>);
<span class="lnr"> 1652 </span>    opt = select.appendChild( document.createElement(<span class="Constant">&quot;option&quot;</span>) );
<span class="lnr"> 1653 </span>    input = div.getElementsByTagName(<span class="Constant">&quot;input&quot;</span>)[ <span class="Constant">0</span> ];
<span class="lnr"> 1654 </span>
<span class="lnr"> 1655 </span>    support = {
<span class="lnr"> 1656 </span><span class="Comment">       // IE strips leading whitespace when .innerHTML is used</span>
<span class="lnr"> 1657 </span><span class="Comment">       // 当使用.innerHTML时,IE脚本存在前导空白</span>
<span class="lnr"> 1658 </span>       <span class="Statement">leadingWhitespace</span>: ( div.firstChild.nodeType === <span class="Constant">3</span> ),
<span class="lnr"> 1659 </span>
<span class="lnr"> 1660 </span><span class="Comment">       // Make sure that tbody elements aren't automatically inserted</span>
<span class="lnr"> 1661 </span><span class="Comment">       // IE will insert them into empty tables</span>
<span class="lnr"> 1662 </span><span class="Comment">       // 确信tbody元素没有被自动插入,IE会在空table中自动插入tbody</span>
<span class="lnr"> 1663 </span>       <span class="Statement">tbody</span>: !div.getElementsByTagName(<span class="Constant">&quot;tbody&quot;</span>).length,
<span class="lnr"> 1664 </span>
<span class="lnr"> 1665 </span><span class="Comment">       // Make sure that link elements get serialized correctly by innerHTML</span>
<span class="lnr"> 1666 </span><span class="Comment">       // This requires a wrapper element in IE</span>
<span class="lnr"> 1667 </span><span class="Comment">       // 确信链接元素被innerHTML正确的处理</span>
<span class="lnr"> 1668 </span><span class="Comment">       // 在IE中需要进行包裹</span>
<span class="lnr"> 1669 </span>       <span class="Statement">htmlSerialize</span>: !!div.getElementsByTagName(<span class="Constant">&quot;link&quot;</span>).length,
<span class="lnr"> 1670 </span>
<span class="lnr"> 1671 </span><span class="Comment">       // Get the style information from getAttribute</span>
<span class="lnr"> 1672 </span><span class="Comment">       // (IE uses .cssText instead)</span>
<span class="lnr"> 1673 </span><span class="Comment">       // 使用getAttribute获取css样式,IE使用.cssText</span>
<span class="lnr"> 1674 </span>       <span class="Statement">style</span>: <span class="Constant">/top/</span>.test( a.getAttribute(<span class="Constant">&quot;style&quot;</span>) ),
<span class="lnr"> 1675 </span>
<span class="lnr"> 1676 </span><span class="Comment">       // Make sure that URLs aren't manipulated</span>
<span class="lnr"> 1677 </span><span class="Comment">       // (IE normalizes it by default)</span>
<span class="lnr"> 1678 </span><span class="Comment">       // 确信URL地址没有被篡改,IE默认会使其标准化</span>
<span class="lnr"> 1679 </span>       <span class="Statement">hrefNormalized</span>: ( a.getAttribute(<span class="Constant">&quot;href&quot;</span>) === <span class="Constant">&quot;/a&quot;</span> ),
<span class="lnr"> 1680 </span>
<span class="lnr"> 1681 </span><span class="Comment">       // Make sure that element opacity exists</span>
<span class="lnr"> 1682 </span><span class="Comment">       // (IE uses filter instead)</span>
<span class="lnr"> 1683 </span><span class="Comment">       // Use a regex to work around a WebKit issue. See #5145</span>
<span class="lnr"> 1684 </span><span class="Comment">       // 确信元素透明存在,IE使用filter,为了在WebKit中也有效,使用正则的方式</span>
<span class="lnr"> 1685 </span>       <span class="Statement">opacity</span>: <span class="Constant">/^0.5/</span>.test( a.style.opacity ),
<span class="lnr"> 1686 </span>
<span class="lnr"> 1687 </span><span class="Comment">       // Verify style float existence</span>
<span class="lnr"> 1688 </span><span class="Comment">       // (IE uses styleFloat instead of cssFloat)</span>
<span class="lnr"> 1689 </span><span class="Comment">       // 验证样式浮动,IE使用styleFloat代替cssFloat</span>
<span class="lnr"> 1690 </span>       <span class="Statement">cssFloat</span>: !!a.style.cssFloat,
<span class="lnr"> 1691 </span>
<span class="lnr"> 1692 </span><span class="Comment">       // Make sure that if no value is specified for a checkbox</span>
<span class="lnr"> 1693 </span><span class="Comment">       // that it defaults to &quot;on&quot;.</span>
<span class="lnr"> 1694 </span><span class="Comment">       // (WebKit defaults to &quot;&quot; instead)</span>
<span class="lnr"> 1695 </span><span class="Comment">       // 确信如果checkbox没有被指定值,默认会被设置为&quot;on&quot;</span>
<span class="lnr"> 1696 </span><span class="Comment">       // WebKit中默认为空字符串</span>
<span class="lnr"> 1697 </span>       <span class="Statement">checkOn</span>: ( input.value === <span class="Constant">&quot;on&quot;</span> ),
<span class="lnr"> 1698 </span>
<span class="lnr"> 1699 </span><span class="Comment">       // Make sure that a selected-by-default option has a working selected property.</span>
<span class="lnr"> 1700 </span><span class="Comment">       // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)</span>
<span class="lnr"> 1701 </span><span class="Comment">       // 确信一个默认选择的选项有一个可以工作的selected属性</span>
<span class="lnr"> 1702 </span><span class="Comment">       // WebKit默认使用false代替了true,如果这个option不是在一个option group中的话,IE也会这样处理</span>
<span class="lnr"> 1703 </span>       <span class="Statement">optSelected</span>: opt.selected,
<span class="lnr"> 1704 </span>
<span class="lnr"> 1705 </span><span class="Comment">       // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)</span>
<span class="lnr"> 1706 </span><span class="Comment">       // 在驼峰规则的class上测试setAttribute,如果可以工作,我们在ie6/7中使用get/setAttribute时需要修复属性</span>
<span class="lnr"> 1707 </span>       <span class="Statement">getSetAttribute</span>: div.className !== <span class="Constant">&quot;t&quot;</span>,
<span class="lnr"> 1708 </span>
<span class="lnr"> 1709 </span><span class="Comment">       // Tests for enctype support on a form(#6743)</span>
<span class="lnr"> 1710 </span><span class="Comment">       // 测试是否支持form加密</span>
<span class="lnr"> 1711 </span>       <span class="Statement">enctype</span>: !!document.createElement(<span class="Constant">&quot;form&quot;</span>).enctype,
<span class="lnr"> 1712 </span>
<span class="lnr"> 1713 </span><span class="Comment">       // Makes sure cloning an html5 element does not cause problems</span>
<span class="lnr"> 1714 </span><span class="Comment">       // Where outerHTML is undefined, this still works</span>
<span class="lnr"> 1715 </span><span class="Comment">       // 确信复制html5元素不会引发问题,当outerHTML没有定义时,仍然可以工作</span>
<span class="lnr"> 1716 </span>       <span class="Statement">html5Clone</span>: document.createElement(<span class="Constant">&quot;nav&quot;</span>).cloneNode( <span class="Constant">true</span> ).outerHTML !== <span class="Constant">&quot;&lt;:nav&gt;&lt;/:nav&gt;&quot;</span>,
<span class="lnr"> 1717 </span>
<span class="lnr"> 1718 </span><span class="Comment">       // jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode</span>
<span class="lnr"> 1719 </span><span class="Comment">       // 自从1.8版本中不支持Quirks Mode以后,jQuery.support.boxModel被标记为过时的</span>
<span class="lnr"> 1720 </span>       <span class="Statement">boxModel</span>: ( document.compatMode === <span class="Constant">&quot;CSS1Compat&quot;</span> ),
<span class="lnr"> 1721 </span>
<span class="lnr"> 1722 </span><span class="Comment">       // Will be defined later</span>
<span class="lnr"> 1723 </span><span class="Comment">       // 会在后面定义</span>
<span class="lnr"> 1724 </span>       <span class="Statement">submitBubbles</span>: <span class="Constant">true</span>,
<span class="lnr"> 1725 </span>       <span class="Statement">changeBubbles</span>: <span class="Constant">true</span>,
<span class="lnr"> 1726 </span>       <span class="Statement">focusinBubbles</span>: <span class="Constant">false</span>,
<span class="lnr"> 1727 </span>       <span class="Statement">deleteExpando</span>: <span class="Constant">true</span>,
<span class="lnr"> 1728 </span>       <span class="Statement">noCloneEvent</span>: <span class="Constant">true</span>,
<span class="lnr"> 1729 </span>       <span class="Statement">inlineBlockNeedsLayout</span>: <span class="Constant">false</span>,
<span class="lnr"> 1730 </span>       <span class="Statement">shrinkWrapBlocks</span>: <span class="Constant">false</span>,
<span class="lnr"> 1731 </span>       <span class="Statement">reliableMarginRight</span>: <span class="Constant">true</span>,
<span class="lnr"> 1732 </span>       <span class="Statement">boxSizingReliable</span>: <span class="Constant">true</span>,
<span class="lnr"> 1733 </span>       <span class="Statement">pixelPosition</span>: <span class="Constant">false</span>
<span class="lnr"> 1734 </span>    };
<span class="lnr"> 1735 </span>
<span class="lnr"> 1736 </span><span class="Comment">    // Make sure checked status is properly cloned</span>
<span class="lnr"> 1737 </span><span class="Comment">    // 确信勾选属性被正确复制</span>
<span class="lnr"> 1738 </span>    input.checked = <span class="Constant">true</span>;
<span class="lnr"> 1739 </span>    support.noCloneChecked = input.cloneNode( <span class="Constant">true</span> ).checked;
<span class="lnr"> 1740 </span>
<span class="lnr"> 1741 </span><span class="Comment">    // Make sure that the options inside disabled selects aren't marked as disabled</span>
<span class="lnr"> 1742 </span><span class="Comment">    // (WebKit marks them as disabled)</span>
<span class="lnr"> 1743 </span><span class="Comment">    // 确信被置为无效的selects中的options没有被标记为无效,WebKit内核把他们也标记为无效</span>
<span class="lnr"> 1744 </span>    select.disabled = <span class="Constant">true</span>;
<span class="lnr"> 1745 </span>    support.optDisabled = !opt.disabled;
<span class="lnr"> 1746 </span>
<span class="lnr"> 1747 </span><span class="Comment">    // Test to see if it's possible to delete an expando from an element</span>
<span class="lnr"> 1748 </span><span class="Comment">    // Fails in Internet Explorer</span>
<span class="lnr"> 1749 </span><span class="Comment">    // 测试是否可以删除一个元素的自定义扩展属性,在IE中失效</span>
<span class="lnr"> 1750 </span>    <span class="Statement">try</span> {
<span class="lnr"> 1751 </span>       <span class="Statement">delete</span> div.test;
<span class="lnr"> 1752 </span>    } <span class="Statement">catch</span>( e ) {
<span class="lnr"> 1753 </span>       support.deleteExpando = <span class="Constant">false</span>;
<span class="lnr"> 1754 </span>    }
<span class="lnr"> 1755 </span>
<span class="lnr"> 1756 </span>    <span class="Statement">if</span> ( !div.addEventListener &amp;&amp; div.attachEvent &amp;&amp; div.fireEvent ) {
<span class="lnr"> 1757 </span>       div.attachEvent( <span class="Constant">&quot;onclick&quot;</span>, clickFn = <span class="Identifier">function</span>() {
<span class="lnr"> 1758 </span><span class="Comment">          // Cloning a node shouldn't copy over any</span>
<span class="lnr"> 1759 </span><span class="Comment">          // bound event handlers (IE does this)</span>
<span class="lnr"> 1760 </span><span class="Comment">          // 复制一个节点的时候不应该复制绑定到节点上的事件</span>
<span class="lnr"> 1761 </span><span class="Comment">          // IE会这么干</span>
<span class="lnr"> 1762 </span>          support.noCloneEvent = <span class="Constant">false</span>;
<span class="lnr"> 1763 </span>       });
<span class="lnr"> 1764 </span>       div.cloneNode( <span class="Constant">true</span> ).fireEvent(<span class="Constant">&quot;onclick&quot;</span>);
<span class="lnr"> 1765 </span>       div.detachEvent( <span class="Constant">&quot;onclick&quot;</span>, clickFn );
<span class="lnr"> 1766 </span>    }
<span class="lnr"> 1767 </span>
<span class="lnr"> 1768 </span><span class="Comment">    // Check if a radio maintains its value</span>
<span class="lnr"> 1769 </span><span class="Comment">    // after being appended to the DOM</span>
<span class="lnr"> 1770 </span><span class="Comment">    // 检查一个单选框在附加到DOM树上后是否含有设置的值</span>
<span class="lnr"> 1771 </span>    input = document.createElement(<span class="Constant">&quot;input&quot;</span>);
<span class="lnr"> 1772 </span>    input.value = <span class="Constant">&quot;t&quot;</span>;
<span class="lnr"> 1773 </span>    input.setAttribute( <span class="Constant">&quot;type&quot;</span>, <span class="Constant">&quot;radio&quot;</span> );
<span class="lnr"> 1774 </span>    support.radioValue = input.value === <span class="Constant">&quot;t&quot;</span>;
<span class="lnr"> 1775 </span>
<span class="lnr"> 1776 </span>    input.setAttribute( <span class="Constant">&quot;checked&quot;</span>, <span class="Constant">&quot;checked&quot;</span> );
<span class="lnr"> 1777 </span>
<span class="lnr"> 1778 </span><span class="Comment">    // #11217 - WebKit loses check when the name is after the checked attribute</span>
<span class="lnr"> 1779 </span><span class="Comment">    // 如果name属性在check属性后被设置,在WebKit中会丢失check属性</span>
<span class="lnr"> 1780 </span>    input.setAttribute( <span class="Constant">&quot;name&quot;</span>, <span class="Constant">&quot;t&quot;</span> );
<span class="lnr"> 1781 </span>
<span class="lnr"> 1782 </span>    div.appendChild( input );
<span class="lnr"> 1783 </span>    fragment = document.createDocumentFragment();
<span class="lnr"> 1784 </span>    fragment.appendChild( div.lastChild );
<span class="lnr"> 1785 </span>
<span class="lnr"> 1786 </span><span class="Comment">    // WebKit doesn't clone checked state correctly in fragments</span>
<span class="lnr"> 1787 </span><span class="Comment">    // WebKit不会正确复制checked状态</span>
<span class="lnr"> 1788 </span>    support.checkClone = fragment.cloneNode( <span class="Constant">true</span> ).cloneNode( <span class="Constant">true</span> ).lastChild.checked;
<span class="lnr"> 1789 </span>
<span class="lnr"> 1790 </span><span class="Comment">    // Check if a disconnected checkbox will retain its checked</span>
<span class="lnr"> 1791 </span><span class="Comment">    // value of true after appended to the DOM (IE6/7)</span>
<span class="lnr"> 1792 </span><span class="Comment">    // 检查一个没有连接的复选框在附加到DOM树后是否会保留checked=true属性</span>
<span class="lnr"> 1793 </span>    support.appendChecked = input.checked;
<span class="lnr"> 1794 </span>
<span class="lnr"> 1795 </span>    fragment.removeChild( input );
<span class="lnr"> 1796 </span>    fragment.appendChild( div );
<span class="lnr"> 1797 </span>
<span class="lnr"> 1798 </span><span class="Comment">    // Technique from Juriy Zaytsev</span>
<span class="lnr"> 1799 </span><span class="Comment">    // <a href="http://perfectionkills.com/detecting-event-support-without-browser-sniffing/">http://perfectionkills.com/detecting-event-support-without-browser-sniffing/</a></span>
<span class="lnr"> 1800 </span><span class="Comment">    // We only care about the case where non-standard event systems</span>
<span class="lnr"> 1801 </span><span class="Comment">    // are used, namely in IE. Short-circuiting here helps us to</span>
<span class="lnr"> 1802 </span><span class="Comment">    // avoid an eval call (in setAttribute) which can cause CSP</span>
<span class="lnr"> 1803 </span><span class="Comment">    // to go haywire. See: <a href="https://developer.mozilla.org/en/Security/CSP">https://developer.mozilla.org/en/Security/CSP</a></span>
<span class="lnr"> 1804 </span><span class="Comment">    // 我们只关心浏览器是否使用非标准事件系统,这里的短路循环会帮助我们避免会引发CSP混乱的调用</span>
<span class="lnr"> 1805 </span>    <span class="Statement">if</span> ( div.attachEvent ) {
<span class="lnr"> 1806 </span><span class="Comment">       // 部分浏览器的事件需要增加on前缀</span>
<span class="lnr"> 1807 </span>       <span class="Statement">for</span> ( i <span class="Statement">in</span> {
<span class="lnr"> 1808 </span>          <span class="Statement">submit</span>: <span class="Constant">true</span>,
<span class="lnr"> 1809 </span>          <span class="Statement">change</span>: <span class="Constant">true</span>,
<span class="lnr"> 1810 </span>          <span class="Statement">focusin</span>: <span class="Constant">true</span>
<span class="lnr"> 1811 </span>       }) {
<span class="lnr"> 1812 </span>          eventName = <span class="Constant">&quot;on&quot;</span> + i;
<span class="lnr"> 1813 </span>          isSupported = ( eventName <span class="Statement">in</span> div );
<span class="lnr"> 1814 </span>          <span class="Statement">if</span> ( !isSupported ) {
<span class="lnr"> 1815 </span>             div.setAttribute( eventName, <span class="Constant">&quot;return;&quot;</span> );
<span class="lnr"> 1816 </span>             isSupported = ( <span class="Statement">typeof</span> div[ eventName ] === <span class="Constant">&quot;function&quot;</span> );
<span class="lnr"> 1817 </span>          }
<span class="lnr"> 1818 </span>          support[ i + <span class="Constant">&quot;Bubbles&quot;</span> ] = isSupported;
<span class="lnr"> 1819 </span>       }
<span class="lnr"> 1820 </span>    }
<span class="lnr"> 1821 </span>
<span class="lnr"> 1822 </span><span class="Comment">    // Run tests that need a body at doc ready</span>
<span class="lnr"> 1823 </span><span class="Comment">    // 在DOM文档准备完成的时候测试需要body节点的用例</span>
<span class="lnr"> 1824 </span>    jQuery(<span class="Identifier">function</span>() {
<span class="lnr"> 1825 </span>       <span class="Type">var</span> container, div, tds, marginDiv,
<span class="lnr"> 1826 </span>          divReset = <span class="Constant">&quot;padding:0;margin:0;border:0;display:block;overflow:hidden;&quot;</span>,
<span class="lnr"> 1827 </span>          body = document.getElementsByTagName(<span class="Constant">&quot;body&quot;</span>)[<span class="Constant">0</span>];
<span class="lnr"> 1828 </span>
<span class="lnr"> 1829 </span>       <span class="Statement">if</span> ( !body ) {
<span class="lnr"> 1830 </span><span class="Comment">          // Return for frameset docs that don't have a body</span>
<span class="lnr"> 1831 </span><span class="Comment">          // frameset节点没有body节点</span>
<span class="lnr"> 1832 </span>          <span class="Statement">return</span>;
<span class="lnr"> 1833 </span>       }
<span class="lnr"> 1834 </span>
<span class="lnr"> 1835 </span>       container = document.createElement(<span class="Constant">&quot;div&quot;</span>);
<span class="lnr"> 1836 </span>       container.style.cssText = <span class="Constant">&quot;visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px&quot;</span>;
<span class="lnr"> 1837 </span>       body.insertBefore( container, body.firstChild );
<span class="lnr"> 1838 </span>
<span class="lnr"> 1839 </span><span class="Comment">       // Construct the test element</span>
<span class="lnr"> 1840 </span><span class="Comment">       // 建立测试元素</span>
<span class="lnr"> 1841 </span>       div = document.createElement(<span class="Constant">&quot;div&quot;</span>);
<span class="lnr"> 1842 </span>       container.appendChild( div );
<span class="lnr"> 1843 </span>
<span class="lnr"> 1844 </span><span class="Comment">       // Check if table cells still have offsetWidth/Height when they are set</span>
<span class="lnr"> 1845 </span><span class="Comment">       // 检查单元格被设置为不可见并且所在行中仍然有可见单元格时,单元格是否有offsetWidth/Height属性</span>
<span class="lnr"> 1846 </span><span class="Comment">       // to display:none and there are still other visible table cells in a</span>
<span class="lnr"> 1847 </span><span class="Comment">       // table row; if so, offsetWidth/Height are not reliable for use when</span>
<span class="lnr"> 1848 </span><span class="Comment">       // 如果如此,当检测一个元素是否可见的时候,offsetWidth/Height属性是不可信的</span>
<span class="lnr"> 1849 </span><span class="Comment">       // determining if an element has been hidden directly using</span>
<span class="lnr"> 1850 </span><span class="Comment">       // display:none (it is still safe to use offsets if a parent element is</span>
<span class="lnr"> 1851 </span><span class="Comment">       // 如果一个父元素被隐藏的话,使用offset仍然是安全的</span>
<span class="lnr"> 1852 </span><span class="Comment">       // hidden; don safety goggles and see bug #4512 for more information).</span>
<span class="lnr"> 1853 </span><span class="Comment">       // (only IE 8 fails this test)</span>
<span class="lnr"> 1854 </span><span class="Comment">       // 只有IE8无法通过这个测试</span>
<span class="lnr"> 1855 </span>       div.innerHTML = <span class="Constant">&quot;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;t&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&quot;</span>;
<span class="lnr"> 1856 </span>       tds = div.getElementsByTagName(<span class="Constant">&quot;td&quot;</span>);
<span class="lnr"> 1857 </span>       tds[ <span class="Constant">0</span> ].style.cssText = <span class="Constant">&quot;padding:0;margin:0;border:0;display:none&quot;</span>;
<span class="lnr"> 1858 </span>       isSupported = ( tds[ <span class="Constant">0</span> ].offsetHeight === <span class="Constant">0</span> );
<span class="lnr"> 1859 </span>
<span class="lnr"> 1860 </span>       tds[ <span class="Constant">0</span> ].style.display = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 1861 </span>       tds[ <span class="Constant">1</span> ].style.display = <span class="Constant">&quot;none&quot;</span>;
<span class="lnr"> 1862 </span>
<span class="lnr"> 1863 </span><span class="Comment">       // Check if empty table cells still have offsetWidth/Height</span>
<span class="lnr"> 1864 </span><span class="Comment">       // (IE &lt;= 8 fail this test)</span>
<span class="lnr"> 1865 </span><span class="Comment">       // 检查空单元格是否具有offsetWidth/Height</span>
<span class="lnr"> 1866 </span><span class="Comment">       // 只有IE8无法通过这个测试</span>
<span class="lnr"> 1867 </span>       support.reliableHiddenOffsets = isSupported &amp;&amp; ( tds[ <span class="Constant">0</span> ].offsetHeight === <span class="Constant">0</span> );
<span class="lnr"> 1868 </span>
<span class="lnr"> 1869 </span><span class="Comment">       // Check box-sizing and margin behavior</span>
<span class="lnr"> 1870 </span><span class="Comment">       // 检查盒大小和边界行为</span>
<span class="lnr"> 1871 </span>       div.innerHTML = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 1872 </span>       div.style.cssText = <span class="Constant">&quot;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;&quot;</span>;
<span class="lnr"> 1873 </span>       support.boxSizing = ( div.offsetWidth === <span class="Constant">4</span> );
<span class="lnr"> 1874 </span>       support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== <span class="Constant">1</span> );
<span class="lnr"> 1875 </span>
<span class="lnr"> 1876 </span><span class="Comment">       // NOTE: To any future maintainer, we've window.getComputedStyle</span>
<span class="lnr"> 1877 </span><span class="Comment">       // because jsdom on node.js will break without it.</span>
<span class="lnr"> 1878 </span><span class="Comment">       // 注意:任何维护的特性,如果没有window.getComputedStyle,jsdom在nodejs中会终止,</span>
<span class="lnr"> 1879 </span>       <span class="Statement">if</span> ( window.getComputedStyle ) {
<span class="lnr"> 1880 </span>          support.pixelPosition = ( window.getComputedStyle( div, <span class="Type">null</span> ) || {} ).top !== <span class="Constant">&quot;1%&quot;</span>;
<span class="lnr"> 1881 </span>          support.boxSizingReliable = ( window.getComputedStyle( div, <span class="Type">null</span> ) || { <span class="Statement">width</span>: <span class="Constant">&quot;4px&quot;</span> } ).width === <span class="Constant">&quot;4px&quot;</span>;
<span class="lnr"> 1882 </span>
<span class="lnr"> 1883 </span><span class="Comment">          // Check if div with explicit width and no margin-right incorrectly</span>
<span class="lnr"> 1884 </span><span class="Comment">          // gets computed margin-right based on width of container. For more</span>
<span class="lnr"> 1885 </span><span class="Comment">          // 检查指明宽度并且没有右边界属性的div是否被错误的根据容器的宽度计算了右边界属性</span>
<span class="lnr"> 1886 </span><span class="Comment">          // info see bug #3333</span>
<span class="lnr"> 1887 </span><span class="Comment">          // Fails in WebKit before Feb 2011 nightlies</span>
<span class="lnr"> 1888 </span><span class="Comment">          // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right</span>
<span class="lnr"> 1889 </span>          marginDiv = document.createElement(<span class="Constant">&quot;div&quot;</span>);
<span class="lnr"> 1890 </span>          marginDiv.style.cssText = div.style.cssText = divReset;
<span class="lnr"> 1891 </span>          marginDiv.style.marginRight = marginDiv.style.width = <span class="Constant">&quot;0&quot;</span>;
<span class="lnr"> 1892 </span>          div.style.width = <span class="Constant">&quot;1px&quot;</span>;
<span class="lnr"> 1893 </span>          div.appendChild( marginDiv );
<span class="lnr"> 1894 </span>          support.reliableMarginRight =
<span class="lnr"> 1895 </span>             !parseFloat( ( window.getComputedStyle( marginDiv, <span class="Type">null</span> ) || {} ).marginRight );
<span class="lnr"> 1896 </span>       }
<span class="lnr"> 1897 </span>
<span class="lnr"> 1898 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> div.style.zoom !== <span class="Constant">&quot;undefined&quot;</span> ) {
<span class="lnr"> 1899 </span><span class="Comment">          // Check if natively block-level elements act like inline-block</span>
<span class="lnr"> 1900 </span><span class="Comment">          // elements when setting their display to 'inline' and giving</span>
<span class="lnr"> 1901 </span><span class="Comment">          // them layout</span>
<span class="lnr"> 1902 </span><span class="Comment">          // (IE &lt; 8 does this)</span>
<span class="lnr"> 1903 </span><span class="Comment">          // IE8以下版本存在该问题</span>
<span class="lnr"> 1904 </span><span class="Comment">          // 测试当使用内置block-level元素被设置display属性为inline并且设置layout的时候表现的像行内块</span>
<span class="lnr"> 1905 </span>          div.innerHTML = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 1906 </span>          div.style.cssText = divReset + <span class="Constant">&quot;width:1px;padding:1px;display:inline;zoom:1&quot;</span>;
<span class="lnr"> 1907 </span>          support.inlineBlockNeedsLayout = ( div.offsetWidth === <span class="Constant">3</span> );
<span class="lnr"> 1908 </span>
<span class="lnr"> 1909 </span><span class="Comment">          // Check if elements with layout shrink-wrap their children</span>
<span class="lnr"> 1910 </span><span class="Comment">          // 检查带有layout属性的元素收缩包裹他们的子节点</span>
<span class="lnr"> 1911 </span><span class="Comment">          // (IE 6 does this)</span>
<span class="lnr"> 1912 </span><span class="Comment">          // IE6存在该问题</span>
<span class="lnr"> 1913 </span>          div.style.display = <span class="Constant">&quot;block&quot;</span>;
<span class="lnr"> 1914 </span>          div.style.overflow = <span class="Constant">&quot;visible&quot;</span>;
<span class="lnr"> 1915 </span>          div.innerHTML = <span class="Constant">&quot;&lt;div&gt;&lt;/div&gt;&quot;</span>;
<span class="lnr"> 1916 </span>          div.firstChild.style.width = <span class="Constant">&quot;5px&quot;</span>;
<span class="lnr"> 1917 </span>          support.shrinkWrapBlocks = ( div.offsetWidth !== <span class="Constant">3</span> );
<span class="lnr"> 1918 </span>
<span class="lnr"> 1919 </span>          container.style.zoom = <span class="Constant">1</span>;
<span class="lnr"> 1920 </span>       }
<span class="lnr"> 1921 </span>
<span class="lnr"> 1922 </span><span class="Comment">       // Null elements to avoid leaks in IE</span>
<span class="lnr"> 1923 </span><span class="Comment">       // 在IE中避免泄露的空元素</span>
<span class="lnr"> 1924 </span>       body.removeChild( container );
<span class="lnr"> 1925 </span>       container = div = tds = marginDiv = <span class="Type">null</span>;
<span class="lnr"> 1926 </span>    });
<span class="lnr"> 1927 </span>
<span class="lnr"> 1928 </span><span class="Comment">    // Null elements to avoid leaks in IE</span>
<span class="lnr"> 1929 </span><span class="Comment">    // 在IE中避免泄露的空元素</span>
<span class="lnr"> 1930 </span>    fragment.removeChild( div );
<span class="lnr"> 1931 </span>    all = a = select = opt = input = fragment = div = <span class="Type">null</span>;
<span class="lnr"> 1932 </span>
<span class="lnr"> 1933 </span>    <span class="Statement">return</span> support;
<span class="lnr"> 1934 </span>})();
<span class="lnr"> 1935 </span><span class="Type">var</span> rbrace = <span class="Constant">/(?:</span><span class="Special">\{</span><span class="Constant">[</span><span class="Special">\s\S</span><span class="Constant">]*</span><span class="Special">\}</span><span class="Constant">|</span><span class="Special">\[</span><span class="Constant">[</span><span class="Special">\s\S</span><span class="Constant">]*</span><span class="Special">\]</span><span class="Constant">)$/</span>,
<span class="lnr"> 1936 </span>    rmultiDash = <span class="Constant">/([A-Z])/g</span>;
<span class="lnr"> 1937 </span>
<span class="lnr"> 1938 </span>jQuery.extend({
<span class="lnr"> 1939 </span>    <span class="Statement">cache</span>: {},
<span class="lnr"> 1940 </span>
<span class="lnr"> 1941 </span>    <span class="Statement">deletedIds</span>: [],
<span class="lnr"> 1942 </span>
<span class="lnr"> 1943 </span><span class="Comment">    // Please use with caution</span>
<span class="lnr"> 1944 </span><span class="Comment">    // 谨慎使用</span>
<span class="lnr"> 1945 </span>    <span class="Statement">uuid</span>: <span class="Constant">0</span>,
<span class="lnr"> 1946 </span>
<span class="lnr"> 1947 </span><span class="Comment">    // Unique for each copy of jQuery on the page</span>
<span class="lnr"> 1948 </span><span class="Comment">    // 区别为页面上每个jQuery对象,jQuery.fn.jquery是版本号</span>
<span class="lnr"> 1949 </span><span class="Comment">    // Non-digits removed to match rinlinejQuery</span>
<span class="lnr"> 1950 </span><span class="Comment">    // 为了匹配正则rinlinejQuery,非数字被替换</span>
<span class="lnr"> 1951 </span>    <span class="Statement">expando</span>: <span class="Constant">&quot;jQuery&quot;</span> + ( jQuery.fn.jquery + <span class="Special">Math</span>.random() ).replace( <span class="Constant">/</span><span class="Special">\D</span><span class="Constant">/g</span>, <span class="Constant">&quot;&quot;</span> ),
<span class="lnr"> 1952 </span>
<span class="lnr"> 1953 </span><span class="Comment">    // The following elements throw uncatchable exceptions if you</span>
<span class="lnr"> 1954 </span><span class="Comment">    // attempt to add expando properties to them.</span>
<span class="lnr"> 1955 </span><span class="Comment">    // 如果向下列元素添加expando属性,会抛出不可捕捉的异常</span>
<span class="lnr"> 1956 </span>    <span class="Statement">noData</span>: {
<span class="lnr"> 1957 </span>       <span class="Constant">&quot;embed&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 1958 </span><span class="Comment">       // Ban all objects except for Flash (which handle expandos)</span>
<span class="lnr"> 1959 </span><span class="Comment">       // 禁止除Flash外的所有的object</span>
<span class="lnr"> 1960 </span>       <span class="Constant">&quot;object&quot;</span>: <span class="Constant">&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot;</span>,
<span class="lnr"> 1961 </span>       <span class="Constant">&quot;applet&quot;</span>: <span class="Constant">true</span>
<span class="lnr"> 1962 </span>    },
<span class="lnr"> 1963 </span>
<span class="lnr"> 1964 </span><span class="Comment">    // 判断是否有该数据,如果是dom元素,会从缓存中获取</span>
<span class="lnr"> 1965 </span>    <span class="Statement">hasData</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 1966 </span>       elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
<span class="lnr"> 1967 </span>       <span class="Statement">return</span> !!elem &amp;&amp; !isEmptyDataObject( elem );
<span class="lnr"> 1968 </span>    },
<span class="lnr"> 1969 </span>
<span class="lnr"> 1970 </span>    <span class="Statement">data</span>: <span class="Identifier">function</span>( elem, name, data, pvt <span class="Comment">/* Internal Use Only */</span> ) {
<span class="lnr"> 1971 </span>       <span class="Statement">if</span> ( !jQuery.acceptData( elem ) ) {
<span class="lnr"> 1972 </span>          <span class="Statement">return</span>;
<span class="lnr"> 1973 </span>       }
<span class="lnr"> 1974 </span>
<span class="lnr"> 1975 </span>       <span class="Type">var</span> thisCache, ret,
<span class="lnr"> 1976 </span>          internalKey = jQuery.expando,
<span class="lnr"> 1977 </span>          getByName = <span class="Statement">typeof</span> name === <span class="Constant">&quot;string&quot;</span>,
<span class="lnr"> 1978 </span>
<span class="lnr"> 1979 </span><span class="Comment">          // We have to handle DOM nodes and JS objects differently because IE6-7</span>
<span class="lnr"> 1980 </span><span class="Comment">          // can't GC object references properly across the DOM-JS boundary</span>
<span class="lnr"> 1981 </span><span class="Comment">          // 由于IE6-7的垃圾回收机制无法正确回收跨越DOM-JS边界的对象,需要区分处理DOM节点和JS对象</span>
<span class="lnr"> 1982 </span>          isNode = elem.nodeType,
<span class="lnr"> 1983 </span>
<span class="lnr"> 1984 </span><span class="Comment">          // Only DOM nodes need the global jQuery cache; JS object data is</span>
<span class="lnr"> 1985 </span><span class="Comment">          // attached directly to the object so GC can occur automatically</span>
<span class="lnr"> 1986 </span><span class="Comment">          // 只有DOM节点需要全局的jQuery缓存；JS对象数据直接附加到对象上,垃圾回收器可以对其进行自动回收</span>
<span class="lnr"> 1987 </span>          cache = isNode ? jQuery.<span class="Statement">cache</span> : elem,
<span class="lnr"> 1988 </span>
<span class="lnr"> 1989 </span><span class="Comment">          // Only defining an ID for JS objects if its cache already exists allows</span>
<span class="lnr"> 1990 </span><span class="Comment">          // the code to shortcut on the same path as a DOM node with no cache</span>
<span class="lnr"> 1991 </span><span class="Comment">          // 如果JS对象已经被缓存,只定义其ID,允许代码处理这些对象像处理没有缓存的DOM节点那样缩短访问路径</span>
<span class="lnr"> 1992 </span>          id = isNode ? elem[ internalKey ] : elem[ internalKey ] &amp;&amp; internalKey;
<span class="lnr"> 1993 </span>
<span class="lnr"> 1994 </span><span class="Comment">       // Avoid doing any more work than we need to when trying to get data on an</span>
<span class="lnr"> 1995 </span><span class="Comment">       // object that has no data at all</span>
<span class="lnr"> 1996 </span><span class="Comment">       // 避免尝试在一个没有自定义数据的对象上获取自定义数据时做任何多余操作</span>
<span class="lnr"> 1997 </span>       <span class="Statement">if</span> ( (!id || !cache[id] || (!pvt &amp;&amp; !cache[id].data)) &amp;&amp; getByName &amp;&amp; data === <span class="Type">undefined</span> ) {
<span class="lnr"> 1998 </span>          <span class="Statement">return</span>;
<span class="lnr"> 1999 </span>       }
<span class="lnr"> 2000 </span>
<span class="lnr"> 2001 </span>       <span class="Statement">if</span> ( !id ) {
<span class="lnr"> 2002 </span><span class="Comment">          // Only DOM nodes need a new unique ID for each element since their data</span>
<span class="lnr"> 2003 </span><span class="Comment">          // ends up in the global cache</span>
<span class="lnr"> 2004 </span><span class="Comment">          // 由于DOM节点的数据在全局缓存中,因此只有DOM节点需要一个新的唯一ID</span>
<span class="lnr"> 2005 </span>          <span class="Statement">if</span> ( isNode ) {
<span class="lnr"> 2006 </span>             elem[ internalKey ] = id = jQuery.deletedIds.pop() || ++jQuery.uuid;
<span class="lnr"> 2007 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 2008 </span>             id = internalKey;
<span class="lnr"> 2009 </span>          }
<span class="lnr"> 2010 </span>       }
<span class="lnr"> 2011 </span>
<span class="lnr"> 2012 </span>       <span class="Statement">if</span> ( !cache[ id ] ) {
<span class="lnr"> 2013 </span>          cache[ id ] = {};
<span class="lnr"> 2014 </span>
<span class="lnr"> 2015 </span><span class="Comment">          // Avoids exposing jQuery metadata on plain JS objects when the object</span>
<span class="lnr"> 2016 </span><span class="Comment">          // is serialized using JSON.stringify</span>
<span class="lnr"> 2017 </span><span class="Comment">          // 避免在使用JSON.stringify序列化普通JS对象的时候泄露jQuery元数据</span>
<span class="lnr"> 2018 </span>          <span class="Statement">if</span> ( !isNode ) {
<span class="lnr"> 2019 </span>             cache[ id ].toJSON = jQuery.noop;
<span class="lnr"> 2020 </span>          }
<span class="lnr"> 2021 </span>       }
<span class="lnr"> 2022 </span>
<span class="lnr"> 2023 </span><span class="Comment">       // An object can be passed to jQuery.data instead of a key/value pair; this gets</span>
<span class="lnr"> 2024 </span><span class="Comment">       // shallow copied over onto the existing cache</span>
<span class="lnr"> 2025 </span><span class="Comment">       // 可以传递一个对象代替键值对,获取现存cache的浅拷贝</span>
<span class="lnr"> 2026 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> name === <span class="Constant">&quot;object&quot;</span> || <span class="Statement">typeof</span> name === <span class="Constant">&quot;function&quot;</span> ) {
<span class="lnr"> 2027 </span>          <span class="Statement">if</span> ( pvt ) {
<span class="lnr"> 2028 </span>             cache[ id ] = jQuery.extend( cache[ id ], name );
<span class="lnr"> 2029 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 2030 </span>             cache[ id ].data = jQuery.extend( cache[ id ].data, name );
<span class="lnr"> 2031 </span>          }
<span class="lnr"> 2032 </span>       }
<span class="lnr"> 2033 </span>
<span class="lnr"> 2034 </span>       thisCache = cache[ id ];
<span class="lnr"> 2035 </span>
<span class="lnr"> 2036 </span><span class="Comment">       // jQuery data() is stored in a separate object inside the object's internal data</span>
<span class="lnr"> 2037 </span><span class="Comment">       // cache in order to avoid key collisions between internal data and user-defined</span>
<span class="lnr"> 2038 </span><span class="Comment">       // data.</span>
<span class="lnr"> 2039 </span><span class="Comment">       // 为了避免内部data和用户自定义data的键冲突</span>
<span class="lnr"> 2040 </span><span class="Comment">       // jQuery的data函数存储在对象的内部data缓存中的一个独立的对象里</span>
<span class="lnr"> 2041 </span>       <span class="Statement">if</span> ( !pvt ) {
<span class="lnr"> 2042 </span>          <span class="Statement">if</span> ( !thisCache.data ) {
<span class="lnr"> 2043 </span>             thisCache.data = {};
<span class="lnr"> 2044 </span>          }
<span class="lnr"> 2045 </span>
<span class="lnr"> 2046 </span>          thisCache = thisCache.data;
<span class="lnr"> 2047 </span>       }
<span class="lnr"> 2048 </span>
<span class="lnr"> 2049 </span>       <span class="Statement">if</span> ( data !== <span class="Type">undefined</span> ) {
<span class="lnr"> 2050 </span>          thisCache[ jQuery.camelCase( name ) ] = data;
<span class="lnr"> 2051 </span>       }
<span class="lnr"> 2052 </span>
<span class="lnr"> 2053 </span><span class="Comment">       // Check for both converted-to-camel and non-converted data property names</span>
<span class="lnr"> 2054 </span><span class="Comment">       // If a data property was specified</span>
<span class="lnr"> 2055 </span><span class="Comment">       // 如果data属性被指定,检查转换为驼峰规则和未转换的数据属性名</span>
<span class="lnr"> 2056 </span>       <span class="Statement">if</span> ( getByName ) {
<span class="lnr"> 2057 </span>
<span class="lnr"> 2058 </span><span class="Comment">          // First Try to find as-is property data</span>
<span class="lnr"> 2059 </span><span class="Comment">          // 先尝试找到数据属性</span>
<span class="lnr"> 2060 </span>          ret = thisCache[ name ];
<span class="lnr"> 2061 </span>
<span class="lnr"> 2062 </span><span class="Comment">          // Test for null|undefined property data</span>
<span class="lnr"> 2063 </span><span class="Comment">          // 测试值是否为空</span>
<span class="lnr"> 2064 </span>          <span class="Statement">if</span> ( ret == <span class="Type">null</span> ) {
<span class="lnr"> 2065 </span>
<span class="lnr"> 2066 </span><span class="Comment">             // Try to find the camelCased property</span>
<span class="lnr"> 2067 </span><span class="Comment">             // 尝试找到驼峰规则属性</span>
<span class="lnr"> 2068 </span>             ret = thisCache[ jQuery.camelCase( name ) ];
<span class="lnr"> 2069 </span>          }
<span class="lnr"> 2070 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 2071 </span>          ret = thisCache;
<span class="lnr"> 2072 </span>       }
<span class="lnr"> 2073 </span>
<span class="lnr"> 2074 </span>       <span class="Statement">return</span> ret;
<span class="lnr"> 2075 </span>    },
<span class="lnr"> 2076 </span>
<span class="lnr"> 2077 </span><span class="Comment">    // 移除自定义数据</span>
<span class="lnr"> 2078 </span>    <span class="Statement">removeData</span>: <span class="Identifier">function</span>( elem, name, pvt <span class="Comment">/* Internal Use Only */</span> ) {
<span class="lnr"> 2079 </span>       <span class="Statement">if</span> ( !jQuery.acceptData( elem ) ) {
<span class="lnr"> 2080 </span>          <span class="Statement">return</span>;
<span class="lnr"> 2081 </span>       }
<span class="lnr"> 2082 </span>
<span class="lnr"> 2083 </span>       <span class="Type">var</span> thisCache, i, l,
<span class="lnr"> 2084 </span>
<span class="lnr"> 2085 </span>          isNode = elem.nodeType,
<span class="lnr"> 2086 </span>
<span class="lnr"> 2087 </span><span class="Comment">          // See jQuery.data for more information</span>
<span class="lnr"> 2088 </span><span class="Comment">          // 参考jQuery.data</span>
<span class="lnr"> 2089 </span>          cache = isNode ? jQuery.<span class="Statement">cache</span> : elem,
<span class="lnr"> 2090 </span>          id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
<span class="lnr"> 2091 </span>
<span class="lnr"> 2092 </span><span class="Comment">       // If there is already no cache entry for this object, there is no</span>
<span class="lnr"> 2093 </span><span class="Comment">       // purpose in continuing</span>
<span class="lnr"> 2094 </span><span class="Comment">       // 判断该对象是否已经没有缓存,如果没有,就不再继续</span>
<span class="lnr"> 2095 </span>       <span class="Statement">if</span> ( !cache[ id ] ) {
<span class="lnr"> 2096 </span>          <span class="Statement">return</span>;
<span class="lnr"> 2097 </span>       }
<span class="lnr"> 2098 </span>
<span class="lnr"> 2099 </span>       <span class="Statement">if</span> ( name ) {
<span class="lnr"> 2100 </span>
<span class="lnr"> 2101 </span>          thisCache = pvt ? cache[ id ] : cache[ id ].data;
<span class="lnr"> 2102 </span>
<span class="lnr"> 2103 </span>          <span class="Statement">if</span> ( thisCache ) {
<span class="lnr"> 2104 </span>
<span class="lnr"> 2105 </span><span class="Comment">             // Support array or space separated string names for data keys</span>
<span class="lnr"> 2106 </span><span class="Comment">             // 支持数组或者空格分割的字符串名字</span>
<span class="lnr"> 2107 </span>             <span class="Statement">if</span> ( !jQuery.isArray( name ) ) {
<span class="lnr"> 2108 </span>
<span class="lnr"> 2109 </span><span class="Comment">                // try the string as a key before any manipulation</span>
<span class="lnr"> 2110 </span><span class="Comment">                // 在进行其他操作前先尝试当做键来使用</span>
<span class="lnr"> 2111 </span>                <span class="Statement">if</span> ( name <span class="Statement">in</span> thisCache ) {
<span class="lnr"> 2112 </span>                   name = [ name ];
<span class="lnr"> 2113 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 2114 </span>
<span class="lnr"> 2115 </span><span class="Comment">                   // split the camel cased version by spaces unless a key with the spaces exists</span>
<span class="lnr"> 2116 </span><span class="Comment">                   // 使用空白分割驼峰规则版本</span>
<span class="lnr"> 2117 </span>                   name = jQuery.camelCase( name );
<span class="lnr"> 2118 </span>                   <span class="Statement">if</span> ( name <span class="Statement">in</span> thisCache ) {
<span class="lnr"> 2119 </span>                      name = [ name ];
<span class="lnr"> 2120 </span>                   } <span class="Statement">else</span> {
<span class="lnr"> 2121 </span>                      name = name.split(<span class="Constant">&quot; &quot;</span>);
<span class="lnr"> 2122 </span>                   }
<span class="lnr"> 2123 </span>                }
<span class="lnr"> 2124 </span>             }
<span class="lnr"> 2125 </span>
<span class="lnr"> 2126 </span><span class="Comment">             // 在对象的thisCache中删除属性</span>
<span class="lnr"> 2127 </span>             <span class="Statement">for</span> ( i = <span class="Constant">0</span>, l = name.length; i &lt; l; i++ ) {
<span class="lnr"> 2128 </span>                <span class="Statement">delete</span> thisCache[ name[i] ];
<span class="lnr"> 2129 </span>             }
<span class="lnr"> 2130 </span>
<span class="lnr"> 2131 </span><span class="Comment">             // If there is no data left in the cache, we want to continue</span>
<span class="lnr"> 2132 </span><span class="Comment">             // and let the cache object itself get destroyed</span>
<span class="lnr"> 2133 </span><span class="Comment">             // 如果缓存中已经没有数据,我们希望继续并且破坏缓存对象</span>
<span class="lnr"> 2134 </span>             <span class="Statement">if</span> ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
<span class="lnr"> 2135 </span>                <span class="Statement">return</span>;
<span class="lnr"> 2136 </span>             }
<span class="lnr"> 2137 </span>          }
<span class="lnr"> 2138 </span>       }
<span class="lnr"> 2139 </span>
<span class="lnr"> 2140 </span><span class="Comment">       // See jQuery.data for more information</span>
<span class="lnr"> 2141 </span><span class="Comment">       // 参考jQuery.data</span>
<span class="lnr"> 2142 </span>       <span class="Statement">if</span> ( !pvt ) {
<span class="lnr"> 2143 </span>          <span class="Statement">delete</span> cache[ id ].data;
<span class="lnr"> 2144 </span>
<span class="lnr"> 2145 </span><span class="Comment">          // Don't destroy the parent cache unless the internal data object</span>
<span class="lnr"> 2146 </span><span class="Comment">          // had been the only thing left in it</span>
<span class="lnr"> 2147 </span><span class="Comment">          // 不破坏父cache,除非其数据只剩下内部数据</span>
<span class="lnr"> 2148 </span>          <span class="Statement">if</span> ( !isEmptyDataObject( cache[ id ] ) ) {
<span class="lnr"> 2149 </span>             <span class="Statement">return</span>;
<span class="lnr"> 2150 </span>          }
<span class="lnr"> 2151 </span>       }
<span class="lnr"> 2152 </span>
<span class="lnr"> 2153 </span><span class="Comment">       // Destroy the cache</span>
<span class="lnr"> 2154 </span><span class="Comment">       // 破坏cache</span>
<span class="lnr"> 2155 </span>       <span class="Statement">if</span> ( isNode ) {
<span class="lnr"> 2156 </span>          jQuery.cleanData( [ elem ], <span class="Constant">true</span> );
<span class="lnr"> 2157 </span>
<span class="lnr"> 2158 </span><span class="Comment">       // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)</span>
<span class="lnr"> 2159 </span><span class="Comment">       // 当支持扩展属性或cache不是一个window对象的时候使用delete</span>
<span class="lnr"> 2160 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( jQuery.support.deleteExpando || cache != cache.window ) {
<span class="lnr"> 2161 </span>          <span class="Statement">delete</span> cache[ id ];
<span class="lnr"> 2162 </span>
<span class="lnr"> 2163 </span><span class="Comment">       // When all else fails, null</span>
<span class="lnr"> 2164 </span><span class="Comment">       // 当所有else都无效,设置为null</span>
<span class="lnr"> 2165 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 2166 </span>          cache[ id ] = <span class="Type">null</span>;
<span class="lnr"> 2167 </span>       }
<span class="lnr"> 2168 </span>    },
<span class="lnr"> 2169 </span>
<span class="lnr"> 2170 </span><span class="Comment">    // For internal use only.</span>
<span class="lnr"> 2171 </span><span class="Comment">    // 内部使用</span>
<span class="lnr"> 2172 </span>    <span class="Statement">_data</span>: <span class="Identifier">function</span>( elem, name, data ) {
<span class="lnr"> 2173 </span>       <span class="Statement">return</span> jQuery.data( elem, name, data, <span class="Constant">true</span> );
<span class="lnr"> 2174 </span>    },
<span class="lnr"> 2175 </span>
<span class="lnr"> 2176 </span><span class="Comment">    // A method for determining if a DOM node can handle the data expando</span>
<span class="lnr"> 2177 </span><span class="Comment">    // 决定DOM节点是否可以处理自定数据的函数</span>
<span class="lnr"> 2178 </span>    <span class="Statement">acceptData</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 2179 </span>       <span class="Type">var</span> noData = elem.nodeName &amp;&amp; jQuery.noData[ elem.nodeName.toLowerCase() ];
<span class="lnr"> 2180 </span>
<span class="lnr"> 2181 </span><span class="Comment">       // nodes accept data unless otherwise specified; rejection can be conditional</span>
<span class="lnr"> 2182 </span><span class="Comment">       // 除非另有说明,节点接收数据,可以选择性拒绝</span>
<span class="lnr"> 2183 </span><span class="Comment">       // ||后面的判断语句判断是否是Flash的object</span>
<span class="lnr"> 2184 </span>       <span class="Statement">return</span> !noData || noData !== <span class="Constant">true</span> &amp;&amp; elem.getAttribute(<span class="Constant">&quot;classid&quot;</span>) === noData;
<span class="lnr"> 2185 </span>    }
<span class="lnr"> 2186 </span>});
<span class="lnr"> 2187 </span>
<span class="lnr"> 2188 </span>jQuery.fn.extend({
<span class="lnr"> 2189 </span><span class="Comment">    // 在DOM元素上附加任意类型的数据,避免了循环引用的内存泄漏风险</span>
<span class="lnr"> 2190 </span>    <span class="Statement">data</span>: <span class="Identifier">function</span>( key, value ) {
<span class="lnr"> 2191 </span>       <span class="Type">var</span> parts, part, attr, name, l,
<span class="lnr"> 2192 </span><span class="Comment">          // 获取dom节点</span>
<span class="lnr"> 2193 </span>          elem = <span class="Type">this</span>[<span class="Constant">0</span>],
<span class="lnr"> 2194 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 2195 </span>          data = <span class="Type">null</span>;
<span class="lnr"> 2196 </span>
<span class="lnr"> 2197 </span><span class="Comment">       // Gets all values</span>
<span class="lnr"> 2198 </span><span class="Comment">       // 获取所有属性,守护方法,用于处理特殊的key</span>
<span class="lnr"> 2199 </span><span class="Comment">       // key是undefined,则认为是取当前jQuery对象中第一个元素的全部数据</span>
<span class="lnr"> 2200 </span>       <span class="Statement">if</span> ( key === <span class="Type">undefined</span> ) {
<span class="lnr"> 2201 </span>          <span class="Statement">if</span> ( <span class="Type">this</span>.length ) {
<span class="lnr"> 2202 </span>             data = jQuery.data( elem );
<span class="lnr"> 2203 </span>
<span class="lnr"> 2204 </span>             <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> &amp;&amp; !jQuery._data( elem, <span class="Constant">&quot;parsedAttrs&quot;</span> ) ) {
<span class="lnr"> 2205 </span><span class="Comment">                // 获取dom节点的属性</span>
<span class="lnr"> 2206 </span>                attr = elem.attributes;
<span class="lnr"> 2207 </span>                <span class="Statement">for</span> ( l = attr.length; i &lt; l; i++ ) {
<span class="lnr"> 2208 </span>                   name = attr[i].name;
<span class="lnr"> 2209 </span>
<span class="lnr"> 2210 </span>                   <span class="Statement">if</span> ( name.indexOf( <span class="Constant">&quot;data-&quot;</span> ) === <span class="Constant">0</span> ) {
<span class="lnr"> 2211 </span><span class="Comment">                      // 转换为驼峰规则</span>
<span class="lnr"> 2212 </span>                      name = jQuery.camelCase( name.substring(<span class="Constant">5</span>) );
<span class="lnr"> 2213 </span>
<span class="lnr"> 2214 </span>                      dataAttr( elem, name, data[ name ] );
<span class="lnr"> 2215 </span>                   }
<span class="lnr"> 2216 </span>                }
<span class="lnr"> 2217 </span><span class="Comment">                // 调用jQuery上的实现</span>
<span class="lnr"> 2218 </span>                jQuery._data( elem, <span class="Constant">&quot;parsedAttrs&quot;</span>, <span class="Constant">true</span> );
<span class="lnr"> 2219 </span>             }
<span class="lnr"> 2220 </span>          }
<span class="lnr"> 2221 </span>
<span class="lnr"> 2222 </span>          <span class="Statement">return</span> data;
<span class="lnr"> 2223 </span>       }
<span class="lnr"> 2224 </span>
<span class="lnr"> 2225 </span><span class="Comment">       // Sets multiple values</span>
<span class="lnr"> 2226 </span><span class="Comment">       // 设置多个值</span>
<span class="lnr"> 2227 </span><span class="Comment">       // key是对象,则对当前jQuery对象迭代调用data</span>
<span class="lnr"> 2228 </span><span class="Comment">        // 在每一个匹配的元素上存储数据key</span>
<span class="lnr"> 2229 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> key === <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 2230 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 2231 </span>             jQuery.data( <span class="Type">this</span>, key );
<span class="lnr"> 2232 </span>          });
<span class="lnr"> 2233 </span>       }
<span class="lnr"> 2234 </span><span class="Comment">        // key是字符串</span>
<span class="lnr"> 2235 </span>       parts = key.split( <span class="Constant">&quot;.&quot;</span>, <span class="Constant">2</span> );
<span class="lnr"> 2236 </span>       parts[<span class="Constant">1</span>] = parts[<span class="Constant">1</span>] ? <span class="Constant">&quot;.&quot;</span> + parts[<span class="Constant">1</span>] : <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 2237 </span>       part = parts[<span class="Constant">1</span>] + <span class="Constant">&quot;!&quot;</span>;
<span class="lnr"> 2238 </span>
<span class="lnr"> 2239 </span><span class="Comment">       // 通过jQuery.access设置属性</span>
<span class="lnr"> 2240 </span>       <span class="Statement">return</span> jQuery.access( <span class="Type">this</span>, <span class="Identifier">function</span>( value ) {
<span class="lnr"> 2241 </span>
<span class="lnr"> 2242 </span>          <span class="Statement">if</span> ( value === <span class="Type">undefined</span> ) {
<span class="lnr"> 2243 </span><span class="Comment">             // 如果value为undefined,则任务是取当前jQuery对象中第一个元素指定名称的数据</span>
<span class="lnr"> 2244 </span>             data = <span class="Type">this</span>.triggerHandler( <span class="Constant">&quot;getData&quot;</span> + part, [ parts[<span class="Constant">0</span>] ] );
<span class="lnr"> 2245 </span>
<span class="lnr"> 2246 </span><span class="Comment">             // Try to fetch any internally stored data first</span>
<span class="lnr"> 2247 </span><span class="Comment">             // 首先尝试获取内部存储的数据</span>
<span class="lnr"> 2248 </span>             <span class="Statement">if</span> ( data === <span class="Type">undefined</span> &amp;&amp; elem ) {
<span class="lnr"> 2249 </span>                data = jQuery.data( elem, key );
<span class="lnr"> 2250 </span>                data = dataAttr( elem, key, data );
<span class="lnr"> 2251 </span>             }
<span class="lnr"> 2252 </span>
<span class="lnr"> 2253 </span>             <span class="Statement">return</span> data === <span class="Type">undefined</span> &amp;&amp; parts[<span class="Constant">1</span>] ?
<span class="lnr"> 2254 </span>                <span class="Type">this</span>.data( parts[<span class="Constant">0</span>] ) :
<span class="lnr"> 2255 </span>                data;
<span class="lnr"> 2256 </span>          }
<span class="lnr"> 2257 </span>
<span class="lnr"> 2258 </span>          parts[<span class="Constant">1</span>] = value;
<span class="lnr"> 2259 </span><span class="Comment">          // 在this上触发相应的处理器并且设置数据</span>
<span class="lnr"> 2260 </span>          <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 2261 </span>             <span class="Type">var</span> self = jQuery( <span class="Type">this</span> );
<span class="lnr"> 2262 </span>
<span class="lnr"> 2263 </span>             self.triggerHandler( <span class="Constant">&quot;setData&quot;</span> + part, parts );
<span class="lnr"> 2264 </span>             jQuery.data( <span class="Type">this</span>, key, value );
<span class="lnr"> 2265 </span>             self.triggerHandler( <span class="Constant">&quot;changeData&quot;</span> + part, parts );
<span class="lnr"> 2266 </span>          });
<span class="lnr"> 2267 </span>       }, <span class="Type">null</span>, value, arguments.length &gt; <span class="Constant">1</span>, <span class="Type">null</span>, <span class="Constant">false</span> );
<span class="lnr"> 2268 </span>    },
<span class="lnr"> 2269 </span>
<span class="lnr"> 2270 </span><span class="Comment">    // 移除数据</span>
<span class="lnr"> 2271 </span>    <span class="Statement">removeData</span>: <span class="Identifier">function</span>( key ) {
<span class="lnr"> 2272 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 2273 </span>          jQuery.removeData( <span class="Type">this</span>, key );
<span class="lnr"> 2274 </span>       });
<span class="lnr"> 2275 </span>    }
<span class="lnr"> 2276 </span>});
<span class="lnr"> 2277 </span>
<span class="lnr"> 2278 </span><span class="Identifier">function</span> dataAttr( elem, key, data ) {
<span class="lnr"> 2279 </span><span class="Comment">    // If nothing was found internally, try to fetch any</span>
<span class="lnr"> 2280 </span><span class="Comment">    // data from the HTML5 data-* attribute</span>
<span class="lnr"> 2281 </span><span class="Comment">    // 如果没有在内部发现属性,尝试匹配HTML5的 data-* 属性</span>
<span class="lnr"> 2282 </span>    <span class="Statement">if</span> ( data === <span class="Type">undefined</span> &amp;&amp; elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 2283 </span>
<span class="lnr"> 2284 </span>       <span class="Type">var</span> name = <span class="Constant">&quot;data-&quot;</span> + key.replace( rmultiDash, <span class="Constant">&quot;-$1&quot;</span> ).toLowerCase();
<span class="lnr"> 2285 </span>
<span class="lnr"> 2286 </span>       data = elem.getAttribute( name );
<span class="lnr"> 2287 </span>
<span class="lnr"> 2288 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> data === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 2289 </span>          <span class="Statement">try</span> {
<span class="lnr"> 2290 </span>             data = data === <span class="Constant">&quot;true&quot;</span> ? <span class="Constant">true</span> :
<span class="lnr"> 2291 </span>             data === <span class="Constant">&quot;false&quot;</span> ? <span class="Constant">false</span> :
<span class="lnr"> 2292 </span>             data === <span class="Constant">&quot;null&quot;</span> ? <span class="Type">null</span> :
<span class="lnr"> 2293 </span><span class="Comment">             // Only convert to a number if it doesn't change the string</span>
<span class="lnr"> 2294 </span><span class="Comment">             // 如果表达式 +data + &quot;&quot; 没有改变字符串,将其转换为数字</span>
<span class="lnr"> 2295 </span>             +data + <span class="Constant">&quot;&quot;</span> === data ? +<span class="Statement">data</span> :
<span class="lnr"> 2296 </span>             rbrace.test( data ) ? jQuery.parseJSON( data ) :
<span class="lnr"> 2297 </span>                data;
<span class="lnr"> 2298 </span>          } <span class="Statement">catch</span>( e ) {}
<span class="lnr"> 2299 </span>
<span class="lnr"> 2300 </span><span class="Comment">          // Make sure we set the data so it isn't changed later</span>
<span class="lnr"> 2301 </span><span class="Comment">          // 确保我们设置了data,这样data不会在以后被改变</span>
<span class="lnr"> 2302 </span>          jQuery.data( elem, key, data );
<span class="lnr"> 2303 </span>
<span class="lnr"> 2304 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 2305 </span>          data = <span class="Type">undefined</span>;
<span class="lnr"> 2306 </span>       }
<span class="lnr"> 2307 </span>    }
<span class="lnr"> 2308 </span>
<span class="lnr"> 2309 </span>    <span class="Statement">return</span> data;
<span class="lnr"> 2310 </span>}
<span class="lnr"> 2311 </span>
<span class="lnr"> 2312 </span><span class="Comment">// checks a cache object for emptiness</span>
<span class="lnr"> 2313 </span><span class="Comment">// 检查一个缓存的对象是否是空的</span>
<span class="lnr"> 2314 </span><span class="Identifier">function</span> isEmptyDataObject( obj ) {
<span class="lnr"> 2315 </span>    <span class="Type">var</span> name;
<span class="lnr"> 2316 </span>    <span class="Statement">for</span> ( name <span class="Statement">in</span> obj ) {
<span class="lnr"> 2317 </span>
<span class="lnr"> 2318 </span><span class="Comment">       // if the public data object is empty, the private is still empty</span>
<span class="lnr"> 2319 </span><span class="Comment">       // 如果公开的data对象是空的,私有的也是空的</span>
<span class="lnr"> 2320 </span>       <span class="Statement">if</span> ( name === <span class="Constant">&quot;data&quot;</span> &amp;&amp; jQuery.isEmptyObject( obj[name] ) ) {
<span class="lnr"> 2321 </span>          <span class="Statement">continue</span>;
<span class="lnr"> 2322 </span>       }
<span class="lnr"> 2323 </span>       <span class="Statement">if</span> ( name !== <span class="Constant">&quot;toJSON&quot;</span> ) {
<span class="lnr"> 2324 </span>          <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 2325 </span>       }
<span class="lnr"> 2326 </span>    }
<span class="lnr"> 2327 </span>
<span class="lnr"> 2328 </span>    <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 2329 </span>}
<span class="lnr"> 2330 </span>jQuery.extend({
<span class="lnr"> 2331 </span>
<span class="lnr"> 2332 </span>    <span class="Comment">/* </span>
<span class="lnr"> 2333 </span><span class="Comment">     * 每个元素均可拥有一到多个由 jQuery 添加的函数队列.在大多数应用程序中,只使用一个队列（名为 fx）</span>
<span class="lnr"> 2334 </span><span class="Comment">     * 队列运行在元素上异步地调用动作序列,而不会终止程序执行.</span>
<span class="lnr"> 2335 </span><span class="Comment">     * 典型例子时调用元素上的多个动画方法.例如:</span>
<span class="lnr"> 2336 </span><span class="Comment">     * $('#foo').slideUp().fadeIn();</span>
<span class="lnr"> 2337 </span><span class="Comment">     * 当这条语句执行时,元素会立即开始其滑动动画,但是淡入过渡被置于 fx 队列</span>
<span class="lnr"> 2338 </span><span class="Comment">     * 只有当滑动过渡完成后才会被调用..queue() 方法允许我们直接对这个函数队列进行操作</span>
<span class="lnr"> 2339 </span><span class="Comment">     * 调用带有回调函数的 .queue() 方法特别有用,它允许我们在队列末端放置一个新函数.</span>
<span class="lnr"> 2340 </span><span class="Comment">     */</span>
<span class="lnr"> 2341 </span>    <span class="Statement">queue</span>: <span class="Identifier">function</span>( elem, type, data ) {
<span class="lnr"> 2342 </span>       <span class="Type">var</span> queue;
<span class="lnr"> 2343 </span>
<span class="lnr"> 2344 </span>       <span class="Statement">if</span> ( elem ) {
<span class="lnr"> 2345 </span>          type = ( type || <span class="Constant">&quot;fx&quot;</span> ) + <span class="Constant">&quot;queue&quot;</span>;
<span class="lnr"> 2346 </span>          queue = jQuery._data( elem, type );
<span class="lnr"> 2347 </span>
<span class="lnr"> 2348 </span><span class="Comment">          // Speed up dequeue by getting out quickly if this is just a lookup</span>
<span class="lnr"> 2349 </span><span class="Comment">          // 如果只是查找,快速退出</span>
<span class="lnr"> 2350 </span>          <span class="Statement">if</span> ( data ) {
<span class="lnr"> 2351 </span>             <span class="Statement">if</span> ( !queue || jQuery.isArray(data) ) {
<span class="lnr"> 2352 </span>                queue = jQuery._data( elem, type, jQuery.makeArray(data) );
<span class="lnr"> 2353 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 2354 </span>                queue.push( data );
<span class="lnr"> 2355 </span>             }
<span class="lnr"> 2356 </span>          }
<span class="lnr"> 2357 </span>          <span class="Statement">return</span> queue || [];
<span class="lnr"> 2358 </span>       }
<span class="lnr"> 2359 </span>    },
<span class="lnr"> 2360 </span>
<span class="lnr"> 2361 </span><span class="Comment">    // 当调用 .dequeue() 时,会从序列中删除下一个函数,然后执行它</span>
<span class="lnr"> 2362 </span><span class="Comment">    // 该函数反过来会（直接或间接地）引发对 .dequeue() 的调用,这样序列才能继续下去.</span>
<span class="lnr"> 2363 </span>    <span class="Statement">dequeue</span>: <span class="Identifier">function</span>( elem, type ) {
<span class="lnr"> 2364 </span>       type = type || <span class="Constant">&quot;fx&quot;</span>;
<span class="lnr"> 2365 </span>
<span class="lnr"> 2366 </span>       <span class="Type">var</span> queue = jQuery.queue( elem, type ),
<span class="lnr"> 2367 </span>          startLength = queue.length,
<span class="lnr"> 2368 </span>          fn = queue.shift(),
<span class="lnr"> 2369 </span>          hooks = jQuery._queueHooks( elem, type ),
<span class="lnr"> 2370 </span>          next = <span class="Identifier">function</span>() {
<span class="lnr"> 2371 </span>             jQuery.dequeue( elem, type );
<span class="lnr"> 2372 </span>          };
<span class="lnr"> 2373 </span>
<span class="lnr"> 2374 </span><span class="Comment">       // If the fx queue is dequeued, always remove the progress sentinel</span>
<span class="lnr"> 2375 </span><span class="Comment">       // 如果fx队列被dequeued,总是移除过程哨兵</span>
<span class="lnr"> 2376 </span>       <span class="Statement">if</span> ( fn === <span class="Constant">&quot;inprogress&quot;</span> ) {
<span class="lnr"> 2377 </span>          fn = queue.shift();
<span class="lnr"> 2378 </span>          startLength--;
<span class="lnr"> 2379 </span>       }
<span class="lnr"> 2380 </span>
<span class="lnr"> 2381 </span>       <span class="Statement">if</span> ( fn ) {
<span class="lnr"> 2382 </span>
<span class="lnr"> 2383 </span><span class="Comment">          // Add a progress sentinel to prevent the fx queue from being</span>
<span class="lnr"> 2384 </span><span class="Comment">          // automatically dequeued</span>
<span class="lnr"> 2385 </span><span class="Comment">          // 添加一个过程哨兵防止fx队列被自动dequeue</span>
<span class="lnr"> 2386 </span>          <span class="Statement">if</span> ( type === <span class="Constant">&quot;fx&quot;</span> ) {
<span class="lnr"> 2387 </span>             queue.unshift( <span class="Constant">&quot;inprogress&quot;</span> );
<span class="lnr"> 2388 </span>          }
<span class="lnr"> 2389 </span>
<span class="lnr"> 2390 </span><span class="Comment">          // clear up the last queue stop function</span>
<span class="lnr"> 2391 </span><span class="Comment">          // 清楚最后的使队列停止的函数</span>
<span class="lnr"> 2392 </span>          <span class="Statement">delete</span> hooks.stop;
<span class="lnr"> 2393 </span>          fn.call( elem, next, hooks );
<span class="lnr"> 2394 </span>       }
<span class="lnr"> 2395 </span>
<span class="lnr"> 2396 </span>       <span class="Statement">if</span> ( !startLength &amp;&amp; hooks ) {
<span class="lnr"> 2397 </span>          hooks.empty.fire();
<span class="lnr"> 2398 </span>       }
<span class="lnr"> 2399 </span>    },
<span class="lnr"> 2400 </span>
<span class="lnr"> 2401 </span><span class="Comment">    // not intended for public consumption - generates a queueHooks object, or returns the current one</span>
<span class="lnr"> 2402 </span><span class="Comment">    // 生成队列钩子对象或者返回当前的钩子</span>
<span class="lnr"> 2403 </span>    <span class="Statement">_queueHooks</span>: <span class="Identifier">function</span>( elem, type ) {
<span class="lnr"> 2404 </span>       <span class="Type">var</span> key = type + <span class="Constant">&quot;queueHooks&quot;</span>;
<span class="lnr"> 2405 </span>       <span class="Statement">return</span> jQuery._data( elem, key ) || jQuery._data( elem, key, {
<span class="lnr"> 2406 </span>          <span class="Statement">empty</span>: jQuery.Callbacks(<span class="Constant">&quot;once memory&quot;</span>).add(<span class="Identifier">function</span>() {
<span class="lnr"> 2407 </span>             jQuery.removeData( elem, type + <span class="Constant">&quot;queue&quot;</span>, <span class="Constant">true</span> );
<span class="lnr"> 2408 </span>             jQuery.removeData( elem, key, <span class="Constant">true</span> );
<span class="lnr"> 2409 </span>          })
<span class="lnr"> 2410 </span>       });
<span class="lnr"> 2411 </span>    }
<span class="lnr"> 2412 </span>});
<span class="lnr"> 2413 </span>
<span class="lnr"> 2414 </span>jQuery.fn.extend({
<span class="lnr"> 2415 </span>    <span class="Statement">queue</span>: <span class="Identifier">function</span>( type, data ) {
<span class="lnr"> 2416 </span>       <span class="Type">var</span> setter = <span class="Constant">2</span>;
<span class="lnr"> 2417 </span>
<span class="lnr"> 2418 </span><span class="Comment">       // 如果type不是字符串,将data作为type,'fx'作为类型</span>
<span class="lnr"> 2419 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> type !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 2420 </span>          data = type;
<span class="lnr"> 2421 </span>          type = <span class="Constant">&quot;fx&quot;</span>;
<span class="lnr"> 2422 </span>          setter--;
<span class="lnr"> 2423 </span>       }
<span class="lnr"> 2424 </span>
<span class="lnr"> 2425 </span><span class="Comment">       // 如果参数小于setter,在this对象的dom对象上调用</span>
<span class="lnr"> 2426 </span>       <span class="Statement">if</span> ( arguments.length &lt; setter ) {
<span class="lnr"> 2427 </span>          <span class="Statement">return</span> jQuery.queue( <span class="Type">this</span>[<span class="Constant">0</span>], type );
<span class="lnr"> 2428 </span>       }
<span class="lnr"> 2429 </span>
<span class="lnr"> 2430 </span>       <span class="Statement">return</span> data === <span class="Type">undefined</span> ?
<span class="lnr"> 2431 </span>          <span class="Type">this</span> :
<span class="lnr"> 2432 </span>          <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 2433 </span>             <span class="Type">var</span> queue = jQuery.queue( <span class="Type">this</span>, type, data );
<span class="lnr"> 2434 </span>
<span class="lnr"> 2435 </span><span class="Comment">             // ensure a hooks for this queue</span>
<span class="lnr"> 2436 </span><span class="Comment">             // 保证队列有个钩子</span>
<span class="lnr"> 2437 </span>             jQuery._queueHooks( <span class="Type">this</span>, type );
<span class="lnr"> 2438 </span>
<span class="lnr"> 2439 </span>             <span class="Statement">if</span> ( type === <span class="Constant">&quot;fx&quot;</span> &amp;&amp; queue[<span class="Constant">0</span>] !== <span class="Constant">&quot;inprogress&quot;</span> ) {
<span class="lnr"> 2440 </span>                jQuery.dequeue( <span class="Type">this</span>, type );
<span class="lnr"> 2441 </span>             }
<span class="lnr"> 2442 </span>          });
<span class="lnr"> 2443 </span>    },
<span class="lnr"> 2444 </span>    <span class="Statement">dequeue</span>: <span class="Identifier">function</span>( type ) {
<span class="lnr"> 2445 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 2446 </span>          jQuery.dequeue( <span class="Type">this</span>, type );
<span class="lnr"> 2447 </span>       });
<span class="lnr"> 2448 </span>    },
<span class="lnr"> 2449 </span><span class="Comment">    // Based off of the plugin by Clint Helfers, with permission.</span>
<span class="lnr"> 2450 </span><span class="Comment">    // 经过Clint Helfers的同意,下列代码基于他的插件</span>
<span class="lnr"> 2451 </span><span class="Comment">    // <a href="http://blindsignals.com/index.php/2009/07/jquery-delay/">http://blindsignals.com/index.php/2009/07/jquery-delay/</a></span>
<span class="lnr"> 2452 </span>    <span class="Statement">delay</span>: <span class="Identifier">function</span>( time, type ) {
<span class="lnr"> 2453 </span>       time = jQuery.fx ? jQuery.fx.speeds[ time ] || <span class="Statement">time</span> : time;
<span class="lnr"> 2454 </span>       type = type || <span class="Constant">&quot;fx&quot;</span>;
<span class="lnr"> 2455 </span>
<span class="lnr"> 2456 </span>       <span class="Statement">return</span> <span class="Type">this</span>.queue( type, <span class="Identifier">function</span>( next, hooks ) {
<span class="lnr"> 2457 </span>          <span class="Type">var</span> timeout = setTimeout( next, time );
<span class="lnr"> 2458 </span>          hooks.stop = <span class="Identifier">function</span>() {
<span class="lnr"> 2459 </span>             clearTimeout( timeout );
<span class="lnr"> 2460 </span>          };
<span class="lnr"> 2461 </span>       });
<span class="lnr"> 2462 </span>    },
<span class="lnr"> 2463 </span><span class="Comment">    // 清空队列</span>
<span class="lnr"> 2464 </span>    <span class="Statement">clearQueue</span>: <span class="Identifier">function</span>( type ) {
<span class="lnr"> 2465 </span>       <span class="Statement">return</span> <span class="Type">this</span>.queue( type || <span class="Constant">&quot;fx&quot;</span>, [] );
<span class="lnr"> 2466 </span>    },
<span class="lnr"> 2467 </span><span class="Comment">    // Get a promise resolved when queues of a certain type</span>
<span class="lnr"> 2468 </span><span class="Comment">    // are emptied (fx is the type by default)</span>
<span class="lnr"> 2469 </span><span class="Comment">    // 当队列为空后,返回一个promise(默认类型为fx)</span>
<span class="lnr"> 2470 </span>    <span class="Statement">promise</span>: <span class="Identifier">function</span>( type, obj ) {
<span class="lnr"> 2471 </span>       <span class="Type">var</span> tmp,
<span class="lnr"> 2472 </span>          count = <span class="Constant">1</span>,
<span class="lnr"> 2473 </span>          defer = jQuery.Deferred(),
<span class="lnr"> 2474 </span>          elements = <span class="Type">this</span>,
<span class="lnr"> 2475 </span>          i = <span class="Type">this</span>.length,
<span class="lnr"> 2476 </span>          resolve = <span class="Identifier">function</span>() {
<span class="lnr"> 2477 </span>             <span class="Statement">if</span> ( !( --count ) ) {
<span class="lnr"> 2478 </span>                defer.resolveWith( elements, [ elements ] );
<span class="lnr"> 2479 </span>             }
<span class="lnr"> 2480 </span>          };
<span class="lnr"> 2481 </span>
<span class="lnr"> 2482 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> type !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 2483 </span>          obj = type;
<span class="lnr"> 2484 </span>          type = <span class="Type">undefined</span>;
<span class="lnr"> 2485 </span>       }
<span class="lnr"> 2486 </span>       type = type || <span class="Constant">&quot;fx&quot;</span>;
<span class="lnr"> 2487 </span>
<span class="lnr"> 2488 </span>       <span class="Statement">while</span>( i-- ) {
<span class="lnr"> 2489 </span>          tmp = jQuery._data( elements[ i ], type + <span class="Constant">&quot;queueHooks&quot;</span> );
<span class="lnr"> 2490 </span>          <span class="Statement">if</span> ( tmp &amp;&amp; tmp.empty ) {
<span class="lnr"> 2491 </span>             count++;
<span class="lnr"> 2492 </span>             tmp.empty.add( resolve );
<span class="lnr"> 2493 </span>          }
<span class="lnr"> 2494 </span>       }
<span class="lnr"> 2495 </span>       resolve();
<span class="lnr"> 2496 </span>       <span class="Statement">return</span> defer.promise( obj );
<span class="lnr"> 2497 </span>    }
<span class="lnr"> 2498 </span>});
<span class="lnr"> 2499 </span><span class="Type">var</span> nodeHook, boolHook, fixSpecified,
<span class="lnr"> 2500 </span>    rclass = <span class="Constant">/[</span><span class="Special">\t\r\n</span><span class="Constant">]/g</span>,
<span class="lnr"> 2501 </span>    rreturn = <span class="Constant">/</span><span class="Special">\r</span><span class="Constant">/g</span>,
<span class="lnr"> 2502 </span>    rtype = <span class="Constant">/^(?:button|input)$/i</span>,
<span class="lnr"> 2503 </span>    rfocusable = <span class="Constant">/^(?:button|input|object|select|textarea)$/i</span>,
<span class="lnr"> 2504 </span>    rclickable = <span class="Constant">/^a(?:rea|)$/i</span>,
<span class="lnr"> 2505 </span>    rboolean = <span class="Constant">/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i</span>,
<span class="lnr"> 2506 </span>    getSetAttribute = jQuery.support.getSetAttribute;
<span class="lnr"> 2507 </span>
<span class="lnr"> 2508 </span>jQuery.fn.extend({
<span class="lnr"> 2509 </span><span class="Comment">    // 使用jQuery中的attr方法</span>
<span class="lnr"> 2510 </span>    <span class="Statement">attr</span>: <span class="Identifier">function</span>( name, value ) {
<span class="lnr"> 2511 </span>       <span class="Statement">return</span> jQuery.access( <span class="Type">this</span>, jQuery.attr, name, value, arguments.length &gt; <span class="Constant">1</span> );
<span class="lnr"> 2512 </span>    },
<span class="lnr"> 2513 </span>
<span class="lnr"> 2514 </span><span class="Comment">    // 在当前jQuery对象包含的DOM中移除属性</span>
<span class="lnr"> 2515 </span>    <span class="Statement">removeAttr</span>: <span class="Identifier">function</span>( name ) {
<span class="lnr"> 2516 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 2517 </span>          jQuery.removeAttr( <span class="Type">this</span>, name );
<span class="lnr"> 2518 </span>       });
<span class="lnr"> 2519 </span>    },
<span class="lnr"> 2520 </span>
<span class="lnr"> 2521 </span><span class="Comment">    // 使用jQuery中的prop方法</span>
<span class="lnr"> 2522 </span>    <span class="Statement">prop</span>: <span class="Identifier">function</span>( name, value ) {
<span class="lnr"> 2523 </span>       <span class="Statement">return</span> jQuery.access( <span class="Type">this</span>, jQuery.prop, name, value, arguments.length &gt; <span class="Constant">1</span> );
<span class="lnr"> 2524 </span>    },
<span class="lnr"> 2525 </span>
<span class="lnr"> 2526 </span><span class="Comment">    // 在当前jQuery对象包含的DOM中移除属性</span>
<span class="lnr"> 2527 </span>    <span class="Statement">removeProp</span>: <span class="Identifier">function</span>( name ) {
<span class="lnr"> 2528 </span>       name = jQuery.propFix[ name ] || name;
<span class="lnr"> 2529 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 2530 </span><span class="Comment">          // try/catch handles cases where IE balks (such as removing a property on window)</span>
<span class="lnr"> 2531 </span>          <span class="Statement">try</span> {
<span class="lnr"> 2532 </span>             <span class="Type">this</span>[ name ] = <span class="Type">undefined</span>;
<span class="lnr"> 2533 </span>             <span class="Statement">delete</span> <span class="Type">this</span>[ name ];
<span class="lnr"> 2534 </span>          } <span class="Statement">catch</span>( e ) {}
<span class="lnr"> 2535 </span>       });
<span class="lnr"> 2536 </span>    },
<span class="lnr"> 2537 </span>
<span class="lnr"> 2538 </span><span class="Comment">    // 添加class</span>
<span class="lnr"> 2539 </span>    <span class="Statement">addClass</span>: <span class="Identifier">function</span>( value ) {
<span class="lnr"> 2540 </span>       <span class="Type">var</span> classNames, i, l, elem,
<span class="lnr"> 2541 </span>          setClass, c, cl;
<span class="lnr"> 2542 </span>
<span class="lnr"> 2543 </span><span class="Comment">       // 如果value是函数,在每个元素上调用,将返回值作为class</span>
<span class="lnr"> 2544 </span>       <span class="Statement">if</span> ( jQuery.isFunction( value ) ) {
<span class="lnr"> 2545 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>( j ) {
<span class="lnr"> 2546 </span>             jQuery( <span class="Type">this</span> ).addClass( value.call(<span class="Type">this</span>, j, <span class="Type">this</span>.className) );
<span class="lnr"> 2547 </span>          });
<span class="lnr"> 2548 </span>       }
<span class="lnr"> 2549 </span>
<span class="lnr"> 2550 </span><span class="Comment">       // 如果class是字符串,使用正则进行分割处理</span>
<span class="lnr"> 2551 </span>       <span class="Statement">if</span> ( value &amp;&amp; <span class="Statement">typeof</span> value === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 2552 </span>          classNames = value.split( core_rspace );
<span class="lnr"> 2553 </span>
<span class="lnr"> 2554 </span><span class="Comment">          // 循环jQuery对象中的每个DOM元素</span>
<span class="lnr"> 2555 </span>          <span class="Statement">for</span> ( i = <span class="Constant">0</span>, l = <span class="Type">this</span>.length; i &lt; l; i++ ) {
<span class="lnr"> 2556 </span>             elem = <span class="Type">this</span>[ i ];
<span class="lnr"> 2557 </span>
<span class="lnr"> 2558 </span>             <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 2559 </span><span class="Comment">                // 如果只添加一个class属性</span>
<span class="lnr"> 2560 </span>                <span class="Statement">if</span> ( !elem.className &amp;&amp; classNames.length === <span class="Constant">1</span> ) {
<span class="lnr"> 2561 </span>                   elem.className = value;
<span class="lnr"> 2562 </span>
<span class="lnr"> 2563 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 2564 </span><span class="Comment">                   // 添加多个class属性</span>
<span class="lnr"> 2565 </span>                   setClass = <span class="Constant">&quot; &quot;</span> + elem.className + <span class="Constant">&quot; &quot;</span>;
<span class="lnr"> 2566 </span>
<span class="lnr"> 2567 </span>                   <span class="Statement">for</span> ( c = <span class="Constant">0</span>, cl = classNames.length; c &lt; cl; c++ ) {
<span class="lnr"> 2568 </span><span class="Comment">                      // ~运算符在-1到正无穷的区间上只有-1返回0,其余均为负值</span>
<span class="lnr"> 2569 </span><span class="Comment">                      // 只有!~-1返回true,不清楚这么写的好处?</span>
<span class="lnr"> 2570 </span>                      <span class="Statement">if</span> ( !~setClass.indexOf( <span class="Constant">&quot; &quot;</span> + classNames[ c ] + <span class="Constant">&quot; &quot;</span> ) ) {
<span class="lnr"> 2571 </span>                         setClass += classNames[ c ] + <span class="Constant">&quot; &quot;</span>;
<span class="lnr"> 2572 </span>                      }
<span class="lnr"> 2573 </span>                   }
<span class="lnr"> 2574 </span><span class="Comment">                   // 移除头尾的空格</span>
<span class="lnr"> 2575 </span>                   elem.className = jQuery.trim( setClass );
<span class="lnr"> 2576 </span>                }
<span class="lnr"> 2577 </span>             }
<span class="lnr"> 2578 </span>          }
<span class="lnr"> 2579 </span>       }
<span class="lnr"> 2580 </span>
<span class="lnr"> 2581 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 2582 </span>    },
<span class="lnr"> 2583 </span>
<span class="lnr"> 2584 </span><span class="Comment">    // 移除class,同添加class</span>
<span class="lnr"> 2585 </span>    <span class="Statement">removeClass</span>: <span class="Identifier">function</span>( value ) {
<span class="lnr"> 2586 </span>       <span class="Type">var</span> removes, className, elem, c, cl, i, l;
<span class="lnr"> 2587 </span>
<span class="lnr"> 2588 </span>       <span class="Statement">if</span> ( jQuery.isFunction( value ) ) {
<span class="lnr"> 2589 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>( j ) {
<span class="lnr"> 2590 </span>             jQuery( <span class="Type">this</span> ).removeClass( value.call(<span class="Type">this</span>, j, <span class="Type">this</span>.className) );
<span class="lnr"> 2591 </span>          });
<span class="lnr"> 2592 </span>       }
<span class="lnr"> 2593 </span>       <span class="Statement">if</span> ( (value &amp;&amp; <span class="Statement">typeof</span> value === <span class="Constant">&quot;string&quot;</span>) || value === <span class="Type">undefined</span> ) {
<span class="lnr"> 2594 </span>          removes = ( value || <span class="Constant">&quot;&quot;</span> ).split( core_rspace );
<span class="lnr"> 2595 </span>
<span class="lnr"> 2596 </span>          <span class="Statement">for</span> ( i = <span class="Constant">0</span>, l = <span class="Type">this</span>.length; i &lt; l; i++ ) {
<span class="lnr"> 2597 </span>             elem = <span class="Type">this</span>[ i ];
<span class="lnr"> 2598 </span>             <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> &amp;&amp; elem.className ) {
<span class="lnr"> 2599 </span>
<span class="lnr"> 2600 </span>                className = (<span class="Constant">&quot; &quot;</span> + elem.className + <span class="Constant">&quot; &quot;</span>).replace( rclass, <span class="Constant">&quot; &quot;</span> );
<span class="lnr"> 2601 </span>
<span class="lnr"> 2602 </span><span class="Comment">                // loop over each item in the removal list</span>
<span class="lnr"> 2603 </span>                <span class="Statement">for</span> ( c = <span class="Constant">0</span>, cl = removes.length; c &lt; cl; c++ ) {
<span class="lnr"> 2604 </span><span class="Comment">                   // Remove until there is nothing to remove,</span>
<span class="lnr"> 2605 </span><span class="Comment">                   // 直到没有东西可以移除</span>
<span class="lnr"> 2606 </span>                   <span class="Statement">while</span> ( className.indexOf(<span class="Constant">&quot; &quot;</span> + removes[ c ] + <span class="Constant">&quot; &quot;</span>) &gt; -<span class="Constant">1</span> ) {
<span class="lnr"> 2607 </span>                      className = className.replace( <span class="Constant">&quot; &quot;</span> + removes[ c ] + <span class="Constant">&quot; &quot;</span> , <span class="Constant">&quot; &quot;</span> );
<span class="lnr"> 2608 </span>                   }
<span class="lnr"> 2609 </span>                }
<span class="lnr"> 2610 </span>                elem.className = value ? jQuery.trim( className ) : <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 2611 </span>             }
<span class="lnr"> 2612 </span>          }
<span class="lnr"> 2613 </span>       }
<span class="lnr"> 2614 </span>
<span class="lnr"> 2615 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 2616 </span>    },
<span class="lnr"> 2617 </span>
<span class="lnr"> 2618 </span><span class="Comment">    // 切换class</span>
<span class="lnr"> 2619 </span>    <span class="Statement">toggleClass</span>: <span class="Identifier">function</span>( value, stateVal ) {
<span class="lnr"> 2620 </span>       <span class="Type">var</span> type = <span class="Statement">typeof</span> value,
<span class="lnr"> 2621 </span>          isBool = <span class="Statement">typeof</span> stateVal === <span class="Constant">&quot;boolean&quot;</span>;
<span class="lnr"> 2622 </span>
<span class="lnr"> 2623 </span><span class="Comment">       // 接受使用函数返回class名的方式</span>
<span class="lnr"> 2624 </span>       <span class="Statement">if</span> ( jQuery.isFunction( value ) ) {
<span class="lnr"> 2625 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>( i ) {
<span class="lnr"> 2626 </span>             jQuery( <span class="Type">this</span> ).toggleClass( value.call(<span class="Type">this</span>, i, <span class="Type">this</span>.className, stateVal), stateVal );
<span class="lnr"> 2627 </span>          });
<span class="lnr"> 2628 </span>       }
<span class="lnr"> 2629 </span>
<span class="lnr"> 2630 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 2631 </span>          <span class="Statement">if</span> ( type === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 2632 </span><span class="Comment">             // toggle individual class names</span>
<span class="lnr"> 2633 </span>             <span class="Type">var</span> className,
<span class="lnr"> 2634 </span>                i = <span class="Constant">0</span>,
<span class="lnr"> 2635 </span><span class="Comment">                  // 由于是在dom数组上调用,所以先包装为jQuery对象</span>
<span class="lnr"> 2636 </span>                self = jQuery( <span class="Type">this</span> ),
<span class="lnr"> 2637 </span>                state = stateVal,
<span class="lnr"> 2638 </span>                classNames = value.split( core_rspace );
<span class="lnr"> 2639 </span>
<span class="lnr"> 2640 </span>             <span class="Statement">while</span> ( (className = classNames[ i++ ]) ) {
<span class="lnr"> 2641 </span><span class="Comment">                // check each className given, space separated list</span>
<span class="lnr"> 2642 </span>                state = isBool ? state : !self.hasClass( className );
<span class="lnr"> 2643 </span><span class="Comment">                // 函数调用</span>
<span class="lnr"> 2644 </span>                self[ state ? <span class="Constant">&quot;addClass&quot;</span> : <span class="Constant">&quot;removeClass&quot;</span> ]( className );
<span class="lnr"> 2645 </span>             }
<span class="lnr"> 2646 </span>
<span class="lnr"> 2647 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( type === <span class="Constant">&quot;undefined&quot;</span> || type === <span class="Constant">&quot;boolean&quot;</span> ) {
<span class="lnr"> 2648 </span>             <span class="Statement">if</span> ( <span class="Type">this</span>.className ) {
<span class="lnr"> 2649 </span><span class="Comment">                // store className if set</span>
<span class="lnr"> 2650 </span>                jQuery._data( <span class="Type">this</span>, <span class="Constant">&quot;__className__&quot;</span>, <span class="Type">this</span>.className );
<span class="lnr"> 2651 </span>             }
<span class="lnr"> 2652 </span>
<span class="lnr"> 2653 </span><span class="Comment">             // toggle whole className</span>
<span class="lnr"> 2654 </span>             <span class="Type">this</span>.className = <span class="Type">this</span>.className || value === <span class="Constant">false</span> ? <span class="Constant">&quot;&quot;</span> : jQuery._data( <span class="Type">this</span>, <span class="Constant">&quot;__className__&quot;</span> ) || <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 2655 </span>          }
<span class="lnr"> 2656 </span>       });
<span class="lnr"> 2657 </span>    },
<span class="lnr"> 2658 </span>
<span class="lnr"> 2659 </span><span class="Comment">    // 是否含有class</span>
<span class="lnr"> 2660 </span>    <span class="Statement">hasClass</span>: <span class="Identifier">function</span>( selector ) {
<span class="lnr"> 2661 </span>       <span class="Type">var</span> className = <span class="Constant">&quot; &quot;</span> + selector + <span class="Constant">&quot; &quot;</span>,
<span class="lnr"> 2662 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 2663 </span>          l = <span class="Type">this</span>.length;
<span class="lnr"> 2664 </span>       <span class="Statement">for</span> ( ; i &lt; l; i++ ) {
<span class="lnr"> 2665 </span>          <span class="Statement">if</span> ( <span class="Type">this</span>[i].nodeType === <span class="Constant">1</span> &amp;&amp; (<span class="Constant">&quot; &quot;</span> + <span class="Type">this</span>[i].className + <span class="Constant">&quot; &quot;</span>).replace(rclass, <span class="Constant">&quot; &quot;</span>).indexOf( className ) &gt; -<span class="Constant">1</span> ) {
<span class="lnr"> 2666 </span>             <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 2667 </span>          }
<span class="lnr"> 2668 </span>       }
<span class="lnr"> 2669 </span>
<span class="lnr"> 2670 </span>       <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 2671 </span>    },
<span class="lnr"> 2672 </span>
<span class="lnr"> 2673 </span>    <span class="Statement">val</span>: <span class="Identifier">function</span>( value ) {
<span class="lnr"> 2674 </span>       <span class="Type">var</span> hooks, ret, isFunction,
<span class="lnr"> 2675 </span><span class="Comment">       // 只取第一个元素的值</span>
<span class="lnr"> 2676 </span>          elem = <span class="Type">this</span>[<span class="Constant">0</span>];
<span class="lnr"> 2677 </span>
<span class="lnr"> 2678 </span><span class="Comment">       // 没有传入参数,说明调用val进行取值操作</span>
<span class="lnr"> 2679 </span>       <span class="Statement">if</span> ( !arguments.length ) {
<span class="lnr"> 2680 </span>          <span class="Statement">if</span> ( elem ) {
<span class="lnr"> 2681 </span>             hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
<span class="lnr"> 2682 </span>
<span class="lnr"> 2683 </span><span class="Comment">             // hooks存在并且含有get属性,则调用get函数获取值</span>
<span class="lnr"> 2684 </span>             <span class="Statement">if</span> ( hooks &amp;&amp; <span class="Constant">&quot;get&quot;</span> <span class="Statement">in</span> hooks &amp;&amp; (ret = hooks.get( elem, <span class="Constant">&quot;value&quot;</span> )) !== <span class="Type">undefined</span> ) {
<span class="lnr"> 2685 </span>                <span class="Statement">return</span> ret;
<span class="lnr"> 2686 </span>             }
<span class="lnr"> 2687 </span>
<span class="lnr"> 2688 </span>             ret = elem.value;
<span class="lnr"> 2689 </span>
<span class="lnr"> 2690 </span>             <span class="Statement">return</span> <span class="Statement">typeof</span> ret === <span class="Constant">&quot;string&quot;</span> ?
<span class="lnr"> 2691 </span><span class="Comment">                // handle most common string cases</span>
<span class="lnr"> 2692 </span>                ret.replace(rreturn, <span class="Constant">&quot;&quot;</span>) :
<span class="lnr"> 2693 </span><span class="Comment">                // handle cases where value is null/undef or number</span>
<span class="lnr"> 2694 </span><span class="Comment">                // 处理null值为空字符串</span>
<span class="lnr"> 2695 </span>                ret == <span class="Type">null</span> ? <span class="Constant">&quot;&quot;</span> : ret;
<span class="lnr"> 2696 </span>          }
<span class="lnr"> 2697 </span>
<span class="lnr"> 2698 </span>          <span class="Statement">return</span>;
<span class="lnr"> 2699 </span>       }
<span class="lnr"> 2700 </span>
<span class="lnr"> 2701 </span><span class="Comment">       // 设置值的操作</span>
<span class="lnr"> 2702 </span>       isFunction = jQuery.isFunction( value );
<span class="lnr"> 2703 </span>
<span class="lnr"> 2704 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>( i ) {
<span class="lnr"> 2705 </span>          <span class="Type">var</span> val,
<span class="lnr"> 2706 </span>             self = jQuery(<span class="Type">this</span>);
<span class="lnr"> 2707 </span>
<span class="lnr"> 2708 </span>          <span class="Statement">if</span> ( <span class="Type">this</span>.nodeType !== <span class="Constant">1</span> ) {
<span class="lnr"> 2709 </span>             <span class="Statement">return</span>;
<span class="lnr"> 2710 </span>          }
<span class="lnr"> 2711 </span>
<span class="lnr"> 2712 </span>          <span class="Statement">if</span> ( isFunction ) {
<span class="lnr"> 2713 </span><span class="Comment">             // 如果传入的参数是函数,则在每个dom元素的值上调用该函数</span>
<span class="lnr"> 2714 </span>             val = value.call( <span class="Type">this</span>, i, self.val() );
<span class="lnr"> 2715 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 2716 </span>             val = value;
<span class="lnr"> 2717 </span>          }
<span class="lnr"> 2718 </span>
<span class="lnr"> 2719 </span><span class="Comment">          // Treat null/undefined as &quot;&quot;; convert numbers to string</span>
<span class="lnr"> 2720 </span><span class="Comment">          // 将null/undefined转换为空字符串,将数字转换为string</span>
<span class="lnr"> 2721 </span>          <span class="Statement">if</span> ( val == <span class="Type">null</span> ) {
<span class="lnr"> 2722 </span>             val = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 2723 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( <span class="Statement">typeof</span> val === <span class="Constant">&quot;number&quot;</span> ) {
<span class="lnr"> 2724 </span>             val += <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 2725 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( jQuery.isArray( val ) ) {
<span class="lnr"> 2726 </span><span class="Comment">             // 处理val是数组的情况</span>
<span class="lnr"> 2727 </span>             val = jQuery.map(val, <span class="Identifier">function</span> ( value ) {
<span class="lnr"> 2728 </span>                <span class="Statement">return</span> value == <span class="Type">null</span> ? <span class="Constant">&quot;&quot;</span> : value + <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 2729 </span>             });
<span class="lnr"> 2730 </span>          }
<span class="lnr"> 2731 </span>
<span class="lnr"> 2732 </span>          hooks = jQuery.valHooks[ <span class="Type">this</span>.type ] || jQuery.valHooks[ <span class="Type">this</span>.nodeName.toLowerCase() ];
<span class="lnr"> 2733 </span>
<span class="lnr"> 2734 </span><span class="Comment">          // If set returns undefined, fall back to normal setting</span>
<span class="lnr"> 2735 </span><span class="Comment">          // 如果没有set方法,使用通常的设置方法</span>
<span class="lnr"> 2736 </span>          <span class="Statement">if</span> ( !hooks || !(<span class="Constant">&quot;set&quot;</span> <span class="Statement">in</span> hooks) || hooks.set( <span class="Type">this</span>, val, <span class="Constant">&quot;value&quot;</span> ) === <span class="Type">undefined</span> ) {
<span class="lnr"> 2737 </span>             <span class="Type">this</span>.value = val;
<span class="lnr"> 2738 </span>          }
<span class="lnr"> 2739 </span>       });
<span class="lnr"> 2740 </span>    }
<span class="lnr"> 2741 </span>});
<span class="lnr"> 2742 </span>
<span class="lnr"> 2743 </span>jQuery.extend({
<span class="lnr"> 2744 </span><span class="Comment">    // 获取元素值的辅助对象</span>
<span class="lnr"> 2745 </span>    <span class="Statement">valHooks</span>: {
<span class="lnr"> 2746 </span>       <span class="Statement">option</span>: {
<span class="lnr"> 2747 </span>          <span class="Statement">get</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 2748 </span><span class="Comment">             // attributes.value is undefined in Blackberry 4.7 but</span>
<span class="lnr"> 2749 </span><span class="Comment">             // uses .value. See #6932</span>
<span class="lnr"> 2750 </span>             <span class="Type">var</span> val = elem.attributes.value;
<span class="lnr"> 2751 </span>             <span class="Statement">return</span> !val || val.specified ? elem.<span class="Statement">value</span> : elem.text;
<span class="lnr"> 2752 </span>          }
<span class="lnr"> 2753 </span>       },
<span class="lnr"> 2754 </span>       <span class="Statement">select</span>: {
<span class="lnr"> 2755 </span>          <span class="Statement">get</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 2756 </span>             <span class="Type">var</span> value, i, max, option,
<span class="lnr"> 2757 </span>                index = elem.selectedIndex,
<span class="lnr"> 2758 </span>                values = [],
<span class="lnr"> 2759 </span>                options = elem.options,
<span class="lnr"> 2760 </span>                one = elem.type === <span class="Constant">&quot;select-one&quot;</span>;
<span class="lnr"> 2761 </span>
<span class="lnr"> 2762 </span><span class="Comment">             // Nothing was selected</span>
<span class="lnr"> 2763 </span><span class="Comment">             // 没有选项被选择</span>
<span class="lnr"> 2764 </span>             <span class="Statement">if</span> ( index &lt; <span class="Constant">0</span> ) {
<span class="lnr"> 2765 </span>                <span class="Statement">return</span> <span class="Type">null</span>;
<span class="lnr"> 2766 </span>             }
<span class="lnr"> 2767 </span>
<span class="lnr"> 2768 </span><span class="Comment">             // Loop through all the selected options</span>
<span class="lnr"> 2769 </span><span class="Comment">             // 遍历所有选项</span>
<span class="lnr"> 2770 </span>             i = one ? index : <span class="Constant">0</span>;
<span class="lnr"> 2771 </span>             max = one ? index + <span class="Statement">1</span> : options.length;
<span class="lnr"> 2772 </span>             <span class="Statement">for</span> ( ; i &lt; max; i++ ) {
<span class="lnr"> 2773 </span>                option = options[ i ];
<span class="lnr"> 2774 </span>
<span class="lnr"> 2775 </span><span class="Comment">                // Don't return options that are disabled or in a disabled optgroup</span>
<span class="lnr"> 2776 </span><span class="Comment">                // 不返回被设置为无效或者在无效选项组中的选项</span>
<span class="lnr"> 2777 </span>                <span class="Statement">if</span> ( option.selected &amp;&amp; (jQuery.support.optDisabled ? !option.<span class="Statement">disabled</span> : option.getAttribute(<span class="Constant">&quot;disabled&quot;</span>) === <span class="Type">null</span>) &amp;&amp;
<span class="lnr"> 2778 </span>                      (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, <span class="Constant">&quot;optgroup&quot;</span> )) ) {
<span class="lnr"> 2779 </span>
<span class="lnr"> 2780 </span><span class="Comment">                   // Get the specific value for the option</span>
<span class="lnr"> 2781 </span><span class="Comment">                   // 获取选项的值</span>
<span class="lnr"> 2782 </span>                   value = jQuery( option ).val();
<span class="lnr"> 2783 </span>
<span class="lnr"> 2784 </span><span class="Comment">                   // We don't need an array for one selects</span>
<span class="lnr"> 2785 </span><span class="Comment">                   // 单选不需要返回数组</span>
<span class="lnr"> 2786 </span>                   <span class="Statement">if</span> ( one ) {
<span class="lnr"> 2787 </span>                      <span class="Statement">return</span> value;
<span class="lnr"> 2788 </span>                   }
<span class="lnr"> 2789 </span>
<span class="lnr"> 2790 </span><span class="Comment">                   // Multi-Selects return an array</span>
<span class="lnr"> 2791 </span><span class="Comment">                   // 多选列表返回数组</span>
<span class="lnr"> 2792 </span>                   values.push( value );
<span class="lnr"> 2793 </span>                }
<span class="lnr"> 2794 </span>             }
<span class="lnr"> 2795 </span>
<span class="lnr"> 2796 </span><span class="Comment">             // Fixes Bug #2551 -- select.val() broken in IE after form.reset()</span>
<span class="lnr"> 2797 </span><span class="Comment">             // 修复bug</span>
<span class="lnr"> 2798 </span>             <span class="Statement">if</span> ( one &amp;&amp; !values.length &amp;&amp; options.length ) {
<span class="lnr"> 2799 </span>                <span class="Statement">return</span> jQuery( options[ index ] ).val();
<span class="lnr"> 2800 </span>             }
<span class="lnr"> 2801 </span>
<span class="lnr"> 2802 </span>             <span class="Statement">return</span> values;
<span class="lnr"> 2803 </span>          },
<span class="lnr"> 2804 </span>
<span class="lnr"> 2805 </span><span class="Comment">          // 设置选项的值</span>
<span class="lnr"> 2806 </span>          <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value ) {
<span class="lnr"> 2807 </span>             <span class="Type">var</span> values = jQuery.makeArray( value );
<span class="lnr"> 2808 </span>
<span class="lnr"> 2809 </span>             jQuery(elem).find(<span class="Constant">&quot;option&quot;</span>).each(<span class="Identifier">function</span>() {
<span class="lnr"> 2810 </span>                <span class="Type">this</span>.selected = jQuery.inArray( jQuery(<span class="Type">this</span>).val(), values ) &gt;= <span class="Constant">0</span>;
<span class="lnr"> 2811 </span>             });
<span class="lnr"> 2812 </span>
<span class="lnr"> 2813 </span>             <span class="Statement">if</span> ( !values.length ) {
<span class="lnr"> 2814 </span>                elem.selectedIndex = -<span class="Constant">1</span>;
<span class="lnr"> 2815 </span>             }
<span class="lnr"> 2816 </span>             <span class="Statement">return</span> values;
<span class="lnr"> 2817 </span>          }
<span class="lnr"> 2818 </span>       }
<span class="lnr"> 2819 </span>    },
<span class="lnr"> 2820 </span>
<span class="lnr"> 2821 </span><span class="Comment">    // Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9</span>
<span class="lnr"> 2822 </span><span class="Comment">    // 1.8中不再使用,在1.9中移除</span>
<span class="lnr"> 2823 </span>    <span class="Statement">attrFn</span>: {},
<span class="lnr"> 2824 </span>
<span class="lnr"> 2825 </span>    <span class="Statement">attr</span>: <span class="Identifier">function</span>( elem, name, value, pass ) {
<span class="lnr"> 2826 </span>       <span class="Type">var</span> ret, hooks, notxml,
<span class="lnr"> 2827 </span>          nType = elem.nodeType;
<span class="lnr"> 2828 </span>
<span class="lnr"> 2829 </span><span class="Comment">       // don't get/set attributes on text, comment and attribute nodes</span>
<span class="lnr"> 2830 </span><span class="Comment">       // 不在文本,注释和属性节点上get/set属性</span>
<span class="lnr"> 2831 </span>       <span class="Statement">if</span> ( !elem || nType === <span class="Constant">3</span> || nType === <span class="Constant">8</span> || nType === <span class="Constant">2</span> ) {
<span class="lnr"> 2832 </span>          <span class="Statement">return</span>;
<span class="lnr"> 2833 </span>       }
<span class="lnr"> 2834 </span>
<span class="lnr"> 2835 </span><span class="Comment">       // 计算属性</span>
<span class="lnr"> 2836 </span>       <span class="Statement">if</span> ( pass &amp;&amp; jQuery.isFunction( jQuery.fn[ name ] ) ) {
<span class="lnr"> 2837 </span>          <span class="Statement">return</span> jQuery( elem )[ name ]( value );
<span class="lnr"> 2838 </span>       }
<span class="lnr"> 2839 </span>
<span class="lnr"> 2840 </span><span class="Comment">       // Fallback to prop when attributes are not supported</span>
<span class="lnr"> 2841 </span><span class="Comment">       // 如果属性不支持,则使用prop</span>
<span class="lnr"> 2842 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem.getAttribute === <span class="Constant">&quot;undefined&quot;</span> ) {
<span class="lnr"> 2843 </span>          <span class="Statement">return</span> jQuery.prop( elem, name, value );
<span class="lnr"> 2844 </span>       }
<span class="lnr"> 2845 </span>
<span class="lnr"> 2846 </span>       notxml = nType !== <span class="Constant">1</span> || !jQuery.isXMLDoc( elem );
<span class="lnr"> 2847 </span>
<span class="lnr"> 2848 </span><span class="Comment">       // All attributes are lowercase</span>
<span class="lnr"> 2849 </span><span class="Comment">       // Grab necessary hook if one is defined</span>
<span class="lnr"> 2850 </span><span class="Comment">       // 所有属性是小写字符</span>
<span class="lnr"> 2851 </span><span class="Comment">       // 获取定义的hook</span>
<span class="lnr"> 2852 </span>       <span class="Statement">if</span> ( notxml ) {
<span class="lnr"> 2853 </span>          name = name.toLowerCase();
<span class="lnr"> 2854 </span>          hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
<span class="lnr"> 2855 </span>       }
<span class="lnr"> 2856 </span>
<span class="lnr"> 2857 </span><span class="Comment">       // 设置属性</span>
<span class="lnr"> 2858 </span>       <span class="Statement">if</span> ( value !== <span class="Type">undefined</span> ) {
<span class="lnr"> 2859 </span>
<span class="lnr"> 2860 </span><span class="Comment">          // 如果value是null,移除该属性</span>
<span class="lnr"> 2861 </span>          <span class="Statement">if</span> ( value === <span class="Type">null</span> ) {
<span class="lnr"> 2862 </span>             jQuery.removeAttr( elem, name );
<span class="lnr"> 2863 </span>             <span class="Statement">return</span>;
<span class="lnr"> 2864 </span>
<span class="lnr"> 2865 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( hooks &amp;&amp; <span class="Constant">&quot;set&quot;</span> <span class="Statement">in</span> hooks &amp;&amp; notxml &amp;&amp; (ret = hooks.set( elem, value, name )) !== <span class="Type">undefined</span> ) {
<span class="lnr"> 2866 </span>             <span class="Statement">return</span> ret;
<span class="lnr"> 2867 </span>
<span class="lnr"> 2868 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 2869 </span>             elem.setAttribute( name, <span class="Constant">&quot;&quot;</span> + value );
<span class="lnr"> 2870 </span>             <span class="Statement">return</span> value;
<span class="lnr"> 2871 </span>          }
<span class="lnr"> 2872 </span>
<span class="lnr"> 2873 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( hooks &amp;&amp; <span class="Constant">&quot;get&quot;</span> <span class="Statement">in</span> hooks &amp;&amp; notxml &amp;&amp; (ret = hooks.get( elem, name )) !== <span class="Type">null</span> ) {
<span class="lnr"> 2874 </span>          <span class="Statement">return</span> ret;
<span class="lnr"> 2875 </span>
<span class="lnr"> 2876 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 2877 </span>
<span class="lnr"> 2878 </span>          ret = elem.getAttribute( name );
<span class="lnr"> 2879 </span>
<span class="lnr"> 2880 </span><span class="Comment">          // Non-existent attributes return null, we normalize to undefined</span>
<span class="lnr"> 2881 </span><span class="Comment">          // 不存在的属性返回null,我们统一为undefined</span>
<span class="lnr"> 2882 </span>          <span class="Statement">return</span> ret === <span class="Type">null</span> ?
<span class="lnr"> 2883 </span>             <span class="Type">undefined</span> :
<span class="lnr"> 2884 </span>             ret;
<span class="lnr"> 2885 </span>       }
<span class="lnr"> 2886 </span>    },
<span class="lnr"> 2887 </span>
<span class="lnr"> 2888 </span>    <span class="Statement">removeAttr</span>: <span class="Identifier">function</span>( elem, value ) {
<span class="lnr"> 2889 </span>       <span class="Type">var</span> propName, attrNames, name, isBool,
<span class="lnr"> 2890 </span>          i = <span class="Constant">0</span>;
<span class="lnr"> 2891 </span>
<span class="lnr"> 2892 </span>       <span class="Statement">if</span> ( value &amp;&amp; elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 2893 </span>
<span class="lnr"> 2894 </span><span class="Comment">          // 分割属性名</span>
<span class="lnr"> 2895 </span>          attrNames = value.split( core_rspace );
<span class="lnr"> 2896 </span>
<span class="lnr"> 2897 </span>          <span class="Statement">for</span> ( ; i &lt; attrNames.length; i++ ) {
<span class="lnr"> 2898 </span>             name = attrNames[ i ];
<span class="lnr"> 2899 </span>
<span class="lnr"> 2900 </span>             <span class="Statement">if</span> ( name ) {
<span class="lnr"> 2901 </span><span class="Comment">                // 修正属性名</span>
<span class="lnr"> 2902 </span>                propName = jQuery.propFix[ name ] || name;
<span class="lnr"> 2903 </span>                isBool = rboolean.test( name );
<span class="lnr"> 2904 </span>
<span class="lnr"> 2905 </span><span class="Comment">                // See #9699 for explanation of this approach (setting first, then removal)</span>
<span class="lnr"> 2906 </span><span class="Comment">                // Do not do this for boolean attributes (see #10870)</span>
<span class="lnr"> 2907 </span><span class="Comment">                // 先设置再移除的原因参见#9699</span>
<span class="lnr"> 2908 </span><span class="Comment">                // 不能这样处理布尔类型的属性</span>
<span class="lnr"> 2909 </span>                <span class="Statement">if</span> ( !isBool ) {
<span class="lnr"> 2910 </span>                   jQuery.attr( elem, name, <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 2911 </span>                }
<span class="lnr"> 2912 </span>                elem.removeAttribute( getSetAttribute ? name : propName );
<span class="lnr"> 2913 </span>
<span class="lnr"> 2914 </span><span class="Comment">                // Set corresponding property to false for boolean attributes</span>
<span class="lnr"> 2915 </span><span class="Comment">                // 设置匹配的布尔类型的属性为false</span>
<span class="lnr"> 2916 </span>                <span class="Statement">if</span> ( isBool &amp;&amp; propName <span class="Statement">in</span> elem ) {
<span class="lnr"> 2917 </span>                   elem[ propName ] = <span class="Constant">false</span>;
<span class="lnr"> 2918 </span>                }
<span class="lnr"> 2919 </span>             }
<span class="lnr"> 2920 </span>          }
<span class="lnr"> 2921 </span>       }
<span class="lnr"> 2922 </span>    },
<span class="lnr"> 2923 </span>
<span class="lnr"> 2924 </span><span class="Comment">    // 属性钩子</span>
<span class="lnr"> 2925 </span>    <span class="Statement">attrHooks</span>: {
<span class="lnr"> 2926 </span>       <span class="Statement">type</span>: {
<span class="lnr"> 2927 </span>          <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value ) {
<span class="lnr"> 2928 </span><span class="Comment">             // We can't allow the type property to be changed (since it causes problems in IE)</span>
<span class="lnr"> 2929 </span><span class="Comment">             // 不允许type属性被改变,因为这样会在IE中引起问题</span>
<span class="lnr"> 2930 </span>             <span class="Statement">if</span> ( rtype.test( elem.nodeName ) &amp;&amp; elem.parentNode ) {
<span class="lnr"> 2931 </span>                jQuery.error( <span class="Constant">&quot;type property can't be changed&quot;</span> );
<span class="lnr"> 2932 </span>             } <span class="Statement">else</span> <span class="Statement">if</span> ( !jQuery.support.radioValue &amp;&amp; value === <span class="Constant">&quot;radio&quot;</span> &amp;&amp; jQuery.nodeName(elem, <span class="Constant">&quot;input&quot;</span>) ) {
<span class="lnr"> 2933 </span><span class="Comment">                // Setting the type on a radio button after the value resets the value in IE6-9</span>
<span class="lnr"> 2934 </span><span class="Comment">                // 在重设value之后设置单选按钮的type属性</span>
<span class="lnr"> 2935 </span><span class="Comment">                // Reset value to it's default in case type is set after value</span>
<span class="lnr"> 2936 </span><span class="Comment">                // 为了防止type在value之后设置,重置value为默认值</span>
<span class="lnr"> 2937 </span><span class="Comment">                // This is for element creation</span>
<span class="lnr"> 2938 </span><span class="Comment">                // 这样是为了创建元素</span>
<span class="lnr"> 2939 </span>                <span class="Type">var</span> val = elem.value;
<span class="lnr"> 2940 </span>                elem.setAttribute( <span class="Constant">&quot;type&quot;</span>, value );
<span class="lnr"> 2941 </span>                <span class="Statement">if</span> ( val ) {
<span class="lnr"> 2942 </span>                   elem.value = val;
<span class="lnr"> 2943 </span>                }
<span class="lnr"> 2944 </span>                <span class="Statement">return</span> value;
<span class="lnr"> 2945 </span>             }
<span class="lnr"> 2946 </span>          }
<span class="lnr"> 2947 </span>       },
<span class="lnr"> 2948 </span><span class="Comment">       // Use the value property for back compat</span>
<span class="lnr"> 2949 </span><span class="Comment">       // 为了向后兼容而使用value属性</span>
<span class="lnr"> 2950 </span><span class="Comment">       // Use the nodeHook for button elements in IE6/7 (#1954)</span>
<span class="lnr"> 2951 </span><span class="Comment">       // 在IE6/7中为button按钮使用nodHook</span>
<span class="lnr"> 2952 </span>       <span class="Statement">value</span>: {
<span class="lnr"> 2953 </span>          <span class="Statement">get</span>: <span class="Identifier">function</span>( elem, name ) {
<span class="lnr"> 2954 </span>             <span class="Statement">if</span> ( nodeHook &amp;&amp; jQuery.nodeName( elem, <span class="Constant">&quot;button&quot;</span> ) ) {
<span class="lnr"> 2955 </span>                <span class="Statement">return</span> nodeHook.get( elem, name );
<span class="lnr"> 2956 </span>             }
<span class="lnr"> 2957 </span>             <span class="Statement">return</span> name <span class="Statement">in</span> elem ?
<span class="lnr"> 2958 </span>                elem.<span class="Statement">value</span> :
<span class="lnr"> 2959 </span>                <span class="Type">null</span>;
<span class="lnr"> 2960 </span>          },
<span class="lnr"> 2961 </span>          <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value, name ) {
<span class="lnr"> 2962 </span>             <span class="Statement">if</span> ( nodeHook &amp;&amp; jQuery.nodeName( elem, <span class="Constant">&quot;button&quot;</span> ) ) {
<span class="lnr"> 2963 </span>                <span class="Statement">return</span> nodeHook.set( elem, value, name );
<span class="lnr"> 2964 </span>             }
<span class="lnr"> 2965 </span><span class="Comment">             // Does not return so that setAttribute is also used</span>
<span class="lnr"> 2966 </span>             elem.value = value;
<span class="lnr"> 2967 </span>          }
<span class="lnr"> 2968 </span>       }
<span class="lnr"> 2969 </span>    },
<span class="lnr"> 2970 </span>
<span class="lnr"> 2971 </span><span class="Comment">    // 修正属性名</span>
<span class="lnr"> 2972 </span>    <span class="Statement">propFix</span>: {
<span class="lnr"> 2973 </span>       <span class="Statement">tabindex</span>: <span class="Constant">&quot;tabIndex&quot;</span>,
<span class="lnr"> 2974 </span>       <span class="Statement">readonly</span>: <span class="Constant">&quot;readOnly&quot;</span>,
<span class="lnr"> 2975 </span>       <span class="Constant">&quot;for&quot;</span>: <span class="Constant">&quot;htmlFor&quot;</span>,
<span class="lnr"> 2976 </span>       <span class="Constant">&quot;class&quot;</span>: <span class="Constant">&quot;className&quot;</span>,
<span class="lnr"> 2977 </span>       <span class="Statement">maxlength</span>: <span class="Constant">&quot;maxLength&quot;</span>,
<span class="lnr"> 2978 </span>       <span class="Statement">cellspacing</span>: <span class="Constant">&quot;cellSpacing&quot;</span>,
<span class="lnr"> 2979 </span>       <span class="Statement">cellpadding</span>: <span class="Constant">&quot;cellPadding&quot;</span>,
<span class="lnr"> 2980 </span>       <span class="Statement">rowspan</span>: <span class="Constant">&quot;rowSpan&quot;</span>,
<span class="lnr"> 2981 </span>       <span class="Statement">colspan</span>: <span class="Constant">&quot;colSpan&quot;</span>,
<span class="lnr"> 2982 </span>       <span class="Statement">usemap</span>: <span class="Constant">&quot;useMap&quot;</span>,
<span class="lnr"> 2983 </span>       <span class="Statement">frameborder</span>: <span class="Constant">&quot;frameBorder&quot;</span>,
<span class="lnr"> 2984 </span>       <span class="Statement">contenteditable</span>: <span class="Constant">&quot;contentEditable&quot;</span>
<span class="lnr"> 2985 </span>    },
<span class="lnr"> 2986 </span>
<span class="lnr"> 2987 </span>    <span class="Statement">prop</span>: <span class="Identifier">function</span>( elem, name, value ) {
<span class="lnr"> 2988 </span>       <span class="Type">var</span> ret, hooks, notxml,
<span class="lnr"> 2989 </span>          nType = elem.nodeType;
<span class="lnr"> 2990 </span>
<span class="lnr"> 2991 </span><span class="Comment">       // don't get/set properties on text, comment and attribute nodes</span>
<span class="lnr"> 2992 </span><span class="Comment">       // 不在文本,注释和属性节点上get/set属性</span>
<span class="lnr"> 2993 </span>       <span class="Statement">if</span> ( !elem || nType === <span class="Constant">3</span> || nType === <span class="Constant">8</span> || nType === <span class="Constant">2</span> ) {
<span class="lnr"> 2994 </span>          <span class="Statement">return</span>;
<span class="lnr"> 2995 </span>       }
<span class="lnr"> 2996 </span>
<span class="lnr"> 2997 </span>       notxml = nType !== <span class="Constant">1</span> || !jQuery.isXMLDoc( elem );
<span class="lnr"> 2998 </span>
<span class="lnr"> 2999 </span>       <span class="Statement">if</span> ( notxml ) {
<span class="lnr"> 3000 </span><span class="Comment">          // Fix name and attach hooks</span>
<span class="lnr"> 3001 </span><span class="Comment">          // 修正属性名,关联钩子</span>
<span class="lnr"> 3002 </span>          name = jQuery.propFix[ name ] || name;
<span class="lnr"> 3003 </span>          hooks = jQuery.propHooks[ name ];
<span class="lnr"> 3004 </span>       }
<span class="lnr"> 3005 </span>
<span class="lnr"> 3006 </span>       <span class="Statement">if</span> ( value !== <span class="Type">undefined</span> ) {
<span class="lnr"> 3007 </span>          <span class="Statement">if</span> ( hooks &amp;&amp; <span class="Constant">&quot;set&quot;</span> <span class="Statement">in</span> hooks &amp;&amp; (ret = hooks.set( elem, value, name )) !== <span class="Type">undefined</span> ) {
<span class="lnr"> 3008 </span>             <span class="Statement">return</span> ret;
<span class="lnr"> 3009 </span>
<span class="lnr"> 3010 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 3011 </span>             <span class="Statement">return</span> ( elem[ name ] = value );
<span class="lnr"> 3012 </span>          }
<span class="lnr"> 3013 </span>
<span class="lnr"> 3014 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 3015 </span>          <span class="Statement">if</span> ( hooks &amp;&amp; <span class="Constant">&quot;get&quot;</span> <span class="Statement">in</span> hooks &amp;&amp; (ret = hooks.get( elem, name )) !== <span class="Type">null</span> ) {
<span class="lnr"> 3016 </span>             <span class="Statement">return</span> ret;
<span class="lnr"> 3017 </span>
<span class="lnr"> 3018 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 3019 </span>             <span class="Statement">return</span> elem[ name ];
<span class="lnr"> 3020 </span>          }
<span class="lnr"> 3021 </span>       }
<span class="lnr"> 3022 </span>    },
<span class="lnr"> 3023 </span>
<span class="lnr"> 3024 </span>    <span class="Statement">propHooks</span>: {
<span class="lnr"> 3025 </span>       <span class="Statement">tabIndex</span>: {
<span class="lnr"> 3026 </span>          <span class="Statement">get</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 3027 </span><span class="Comment">             // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set</span>
<span class="lnr"> 3028 </span><span class="Comment">             // 如果元素的tabIndex没有被显式设置的话,elem.tabIndex并不总是返回正确的值</span>
<span class="lnr"> 3029 </span><span class="Comment">             // <a href="http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/">http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/</a></span>
<span class="lnr"> 3030 </span>             <span class="Type">var</span> attributeNode = elem.getAttributeNode(<span class="Constant">&quot;tabindex&quot;</span>);
<span class="lnr"> 3031 </span>
<span class="lnr"> 3032 </span>             <span class="Statement">return</span> attributeNode &amp;&amp; attributeNode.specified ?
<span class="lnr"> 3033 </span>                parseInt( attributeNode.value, <span class="Constant">10</span> ) :
<span class="lnr"> 3034 </span>                rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) &amp;&amp; elem.href ?
<span class="lnr"> 3035 </span>                   <span class="Statement">0</span> :
<span class="lnr"> 3036 </span>                   <span class="Type">undefined</span>;
<span class="lnr"> 3037 </span>          }
<span class="lnr"> 3038 </span>       }
<span class="lnr"> 3039 </span>    }
<span class="lnr"> 3040 </span>});
<span class="lnr"> 3041 </span>
<span class="lnr"> 3042 </span><span class="Comment">// Hook for boolean attributes</span>
<span class="lnr"> 3043 </span><span class="Comment">// 布尔类型属性的钩子</span>
<span class="lnr"> 3044 </span>boolHook = {
<span class="lnr"> 3045 </span>    <span class="Statement">get</span>: <span class="Identifier">function</span>( elem, name ) {
<span class="lnr"> 3046 </span><span class="Comment">       // Align boolean attributes with corresponding properties</span>
<span class="lnr"> 3047 </span><span class="Comment">       // 在匹配的properties上设置布尔属性</span>
<span class="lnr"> 3048 </span><span class="Comment">       // Fall back to attribute presence where some booleans are not supported</span>
<span class="lnr"> 3049 </span><span class="Comment">       // 如果有些属性不被支持,则使用attribute</span>
<span class="lnr"> 3050 </span>       <span class="Type">var</span> attrNode,
<span class="lnr"> 3051 </span>          property = jQuery.prop( elem, name );
<span class="lnr"> 3052 </span>       <span class="Statement">return</span> property === <span class="Constant">true</span> || <span class="Statement">typeof</span> property !== <span class="Constant">&quot;boolean&quot;</span> &amp;&amp; ( attrNode = elem.getAttributeNode(name) ) &amp;&amp; attrNode.nodeValue !== <span class="Constant">false</span> ?
<span class="lnr"> 3053 </span>          name.toLowerCase() :
<span class="lnr"> 3054 </span>          <span class="Type">undefined</span>;
<span class="lnr"> 3055 </span>    },
<span class="lnr"> 3056 </span>    <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value, name ) {
<span class="lnr"> 3057 </span>       <span class="Type">var</span> propName;
<span class="lnr"> 3058 </span>       <span class="Statement">if</span> ( value === <span class="Constant">false</span> ) {
<span class="lnr"> 3059 </span><span class="Comment">          // Remove boolean attributes when set to false</span>
<span class="lnr"> 3060 </span><span class="Comment">          // 当attributes被设置为false时移除该属性</span>
<span class="lnr"> 3061 </span>          jQuery.removeAttr( elem, name );
<span class="lnr"> 3062 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 3063 </span><span class="Comment">          // value is true since we know at this point it's type boolean and not false</span>
<span class="lnr"> 3064 </span><span class="Comment">          // 当类型为布尔类型并且不为false,则认为为true</span>
<span class="lnr"> 3065 </span><span class="Comment">          // Set boolean attributes to the same name and set the DOM property</span>
<span class="lnr"> 3066 </span><span class="Comment">          // 设置匹配名字的布尔属性,并且设置DOM属性</span>
<span class="lnr"> 3067 </span>          propName = jQuery.propFix[ name ] || name;
<span class="lnr"> 3068 </span>          <span class="Statement">if</span> ( propName <span class="Statement">in</span> elem ) {
<span class="lnr"> 3069 </span><span class="Comment">             // Only set the IDL specifically if it already exists on the element</span>
<span class="lnr"> 3070 </span><span class="Comment">             // 如果已经在元素上存在的话,只设置IDL</span>
<span class="lnr"> 3071 </span>             elem[ propName ] = <span class="Constant">true</span>;
<span class="lnr"> 3072 </span>          }
<span class="lnr"> 3073 </span>
<span class="lnr"> 3074 </span>          elem.setAttribute( name, name.toLowerCase() );
<span class="lnr"> 3075 </span>       }
<span class="lnr"> 3076 </span>       <span class="Statement">return</span> name;
<span class="lnr"> 3077 </span>    }
<span class="lnr"> 3078 </span>};
<span class="lnr"> 3079 </span>
<span class="lnr"> 3080 </span><span class="Comment">// IE6/7 do not support getting/setting some attributes with get/setAttribute</span>
<span class="lnr"> 3081 </span><span class="Comment">// IE6/7不支持使用get/setAttribute设置某些属性</span>
<span class="lnr"> 3082 </span><span class="Statement">if</span> ( !getSetAttribute ) {
<span class="lnr"> 3083 </span>
<span class="lnr"> 3084 </span>    fixSpecified = {
<span class="lnr"> 3085 </span>       <span class="Statement">name</span>: <span class="Constant">true</span>,
<span class="lnr"> 3086 </span>       <span class="Statement">id</span>: <span class="Constant">true</span>,
<span class="lnr"> 3087 </span>       <span class="Statement">coords</span>: <span class="Constant">true</span>
<span class="lnr"> 3088 </span>    };
<span class="lnr"> 3089 </span>
<span class="lnr"> 3090 </span><span class="Comment">    // Use this for any attribute in IE6/7</span>
<span class="lnr"> 3091 </span><span class="Comment">    // 在IE6/7中设置任何属性都是用这个钩子</span>
<span class="lnr"> 3092 </span><span class="Comment">    // This fixes almost every IE6/7 issue</span>
<span class="lnr"> 3093 </span><span class="Comment">    // 几乎可以修复所有IE6/7</span>
<span class="lnr"> 3094 </span>    nodeHook = jQuery.valHooks.button = {
<span class="lnr"> 3095 </span>       <span class="Statement">get</span>: <span class="Identifier">function</span>( elem, name ) {
<span class="lnr"> 3096 </span>          <span class="Type">var</span> ret;
<span class="lnr"> 3097 </span>          ret = elem.getAttributeNode( name );
<span class="lnr"> 3098 </span>          <span class="Statement">return</span> ret &amp;&amp; ( fixSpecified[ name ] ? ret.value !== <span class="Constant">&quot;&quot;</span> : ret.specified ) ?
<span class="lnr"> 3099 </span>             ret.<span class="Statement">value</span> :
<span class="lnr"> 3100 </span>             <span class="Type">undefined</span>;
<span class="lnr"> 3101 </span>       },
<span class="lnr"> 3102 </span>       <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value, name ) {
<span class="lnr"> 3103 </span><span class="Comment">          // Set the existing or create a new attribute node</span>
<span class="lnr"> 3104 </span><span class="Comment">          // 设置已经存在的属性或者创建一个系的属性节点</span>
<span class="lnr"> 3105 </span>          <span class="Type">var</span> ret = elem.getAttributeNode( name );
<span class="lnr"> 3106 </span>          <span class="Statement">if</span> ( !ret ) {
<span class="lnr"> 3107 </span>             ret = document.createAttribute( name );
<span class="lnr"> 3108 </span>             elem.setAttributeNode( ret );
<span class="lnr"> 3109 </span>          }
<span class="lnr"> 3110 </span>          <span class="Statement">return</span> ( ret.value = value + <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 3111 </span>       }
<span class="lnr"> 3112 </span>    };
<span class="lnr"> 3113 </span>
<span class="lnr"> 3114 </span><span class="Comment">    // Set width and height to auto instead of 0 on empty string( Bug #8150 )</span>
<span class="lnr"> 3115 </span><span class="Comment">    // 如果字符串为空,不再设置为0,而是设置width和height属性为auto</span>
<span class="lnr"> 3116 </span><span class="Comment">    // This is for removals</span>
<span class="lnr"> 3117 </span>    jQuery.each([ <span class="Constant">&quot;width&quot;</span>, <span class="Constant">&quot;height&quot;</span> ], <span class="Identifier">function</span>( i, name ) {
<span class="lnr"> 3118 </span>       jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
<span class="lnr"> 3119 </span>          <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value ) {
<span class="lnr"> 3120 </span>             <span class="Statement">if</span> ( value === <span class="Constant">&quot;&quot;</span> ) {
<span class="lnr"> 3121 </span>                elem.setAttribute( name, <span class="Constant">&quot;auto&quot;</span> );
<span class="lnr"> 3122 </span>                <span class="Statement">return</span> value;
<span class="lnr"> 3123 </span>             }
<span class="lnr"> 3124 </span>          }
<span class="lnr"> 3125 </span>       });
<span class="lnr"> 3126 </span>    });
<span class="lnr"> 3127 </span>
<span class="lnr"> 3128 </span><span class="Comment">    // Set contenteditable to false on removals(#10429)</span>
<span class="lnr"> 3129 </span><span class="Comment">    // 移除时设置可编辑属性为false</span>
<span class="lnr"> 3130 </span><span class="Comment">    // Setting to empty string throws an error as an invalid value</span>
<span class="lnr"> 3131 </span><span class="Comment">    // 设置为空字符串会抛出一个不合法的值的错误</span>
<span class="lnr"> 3132 </span>    jQuery.attrHooks.contenteditable = {
<span class="lnr"> 3133 </span>       <span class="Statement">get</span>: nodeHook.get,
<span class="lnr"> 3134 </span>       <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value, name ) {
<span class="lnr"> 3135 </span>          <span class="Statement">if</span> ( value === <span class="Constant">&quot;&quot;</span> ) {
<span class="lnr"> 3136 </span>             value = <span class="Constant">&quot;false&quot;</span>;
<span class="lnr"> 3137 </span>          }
<span class="lnr"> 3138 </span>          nodeHook.set( elem, value, name );
<span class="lnr"> 3139 </span>       }
<span class="lnr"> 3140 </span>    };
<span class="lnr"> 3141 </span>}
<span class="lnr"> 3142 </span>
<span class="lnr"> 3143 </span>
<span class="lnr"> 3144 </span><span class="Comment">// Some attributes require a special call on IE</span>
<span class="lnr"> 3145 </span><span class="Comment">// 在IE中一些属性需要特殊调用</span>
<span class="lnr"> 3146 </span><span class="Statement">if</span> ( !jQuery.support.hrefNormalized ) {
<span class="lnr"> 3147 </span>    jQuery.each([ <span class="Constant">&quot;href&quot;</span>, <span class="Constant">&quot;src&quot;</span>, <span class="Constant">&quot;width&quot;</span>, <span class="Constant">&quot;height&quot;</span> ], <span class="Identifier">function</span>( i, name ) {
<span class="lnr"> 3148 </span>       jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
<span class="lnr"> 3149 </span>          <span class="Statement">get</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 3150 </span>             <span class="Type">var</span> ret = elem.getAttribute( name, <span class="Constant">2</span> );
<span class="lnr"> 3151 </span>             <span class="Statement">return</span> ret === <span class="Type">null</span> ? <span class="Type">undefined</span> : ret;
<span class="lnr"> 3152 </span>          }
<span class="lnr"> 3153 </span>       });
<span class="lnr"> 3154 </span>    });
<span class="lnr"> 3155 </span>}
<span class="lnr"> 3156 </span>
<span class="lnr"> 3157 </span><span class="Statement">if</span> ( !jQuery.support.style ) {
<span class="lnr"> 3158 </span>    jQuery.attrHooks.style = {
<span class="lnr"> 3159 </span>       <span class="Statement">get</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 3160 </span><span class="Comment">          // Return undefined in the case of empty string</span>
<span class="lnr"> 3161 </span><span class="Comment">          // 空字符串时返回undefined</span>
<span class="lnr"> 3162 </span><span class="Comment">          // Normalize to lowercase since IE uppercases css property names</span>
<span class="lnr"> 3163 </span><span class="Comment">          // 规范IE的大写css属性为小写</span>
<span class="lnr"> 3164 </span>          <span class="Statement">return</span> elem.style.cssText.toLowerCase() || <span class="Type">undefined</span>;
<span class="lnr"> 3165 </span>       },
<span class="lnr"> 3166 </span>       <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value ) {
<span class="lnr"> 3167 </span>          <span class="Statement">return</span> ( elem.style.cssText = <span class="Constant">&quot;&quot;</span> + value );
<span class="lnr"> 3168 </span>       }
<span class="lnr"> 3169 </span>    };
<span class="lnr"> 3170 </span>}
<span class="lnr"> 3171 </span>
<span class="lnr"> 3172 </span><span class="Comment">// Safari mis-reports the default selected property of an option</span>
<span class="lnr"> 3173 </span><span class="Comment">// Safari不会报告option的默认选择属性</span>
<span class="lnr"> 3174 </span><span class="Comment">// Accessing the parent's selectedIndex property fixes it</span>
<span class="lnr"> 3175 </span><span class="Comment">// 访问父节点的selectedIndex属性进行修复</span>
<span class="lnr"> 3176 </span><span class="Statement">if</span> ( !jQuery.support.optSelected ) {
<span class="lnr"> 3177 </span>    jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
<span class="lnr"> 3178 </span>       <span class="Statement">get</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 3179 </span>          <span class="Type">var</span> parent = elem.parentNode;
<span class="lnr"> 3180 </span>
<span class="lnr"> 3181 </span>          <span class="Statement">if</span> ( parent ) {
<span class="lnr"> 3182 </span>             parent.selectedIndex;
<span class="lnr"> 3183 </span>
<span class="lnr"> 3184 </span><span class="Comment">             // Make sure that it also works with optgroups, see #5701</span>
<span class="lnr"> 3185 </span><span class="Comment">             // 保证在optgroups上也会起作用</span>
<span class="lnr"> 3186 </span>             <span class="Statement">if</span> ( parent.parentNode ) {
<span class="lnr"> 3187 </span>                parent.parentNode.selectedIndex;
<span class="lnr"> 3188 </span>             }
<span class="lnr"> 3189 </span>          }
<span class="lnr"> 3190 </span>          <span class="Statement">return</span> <span class="Type">null</span>;
<span class="lnr"> 3191 </span>       }
<span class="lnr"> 3192 </span>    });
<span class="lnr"> 3193 </span>}
<span class="lnr"> 3194 </span>
<span class="lnr"> 3195 </span><span class="Comment">// IE6/7 call enctype encoding</span>
<span class="lnr"> 3196 </span><span class="Comment">// 在IE6/7中enctype对应的是encoding</span>
<span class="lnr"> 3197 </span><span class="Statement">if</span> ( !jQuery.support.enctype ) {
<span class="lnr"> 3198 </span>    jQuery.propFix.enctype = <span class="Constant">&quot;encoding&quot;</span>;
<span class="lnr"> 3199 </span>}
<span class="lnr"> 3200 </span>
<span class="lnr"> 3201 </span><span class="Comment">// Radios and checkboxes getter/setter</span>
<span class="lnr"> 3202 </span><span class="Comment">// 单选和复选按钮的getter/setter</span>
<span class="lnr"> 3203 </span><span class="Statement">if</span> ( !jQuery.support.checkOn ) {
<span class="lnr"> 3204 </span>    jQuery.each([ <span class="Constant">&quot;radio&quot;</span>, <span class="Constant">&quot;checkbox&quot;</span> ], <span class="Identifier">function</span>() {
<span class="lnr"> 3205 </span>       jQuery.valHooks[ <span class="Type">this</span> ] = {
<span class="lnr"> 3206 </span>          <span class="Statement">get</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 3207 </span><span class="Comment">             // Handle the case where in Webkit &quot;&quot; is returned instead of &quot;on&quot; if a value isn't specified</span>
<span class="lnr"> 3208 </span>             <span class="Statement">return</span> elem.getAttribute(<span class="Constant">&quot;value&quot;</span>) === <span class="Type">null</span> ? <span class="Constant">&quot;on&quot;</span> : elem.value;
<span class="lnr"> 3209 </span>          }
<span class="lnr"> 3210 </span>       };
<span class="lnr"> 3211 </span>    });
<span class="lnr"> 3212 </span>}
<span class="lnr"> 3213 </span>jQuery.each([ <span class="Constant">&quot;radio&quot;</span>, <span class="Constant">&quot;checkbox&quot;</span> ], <span class="Identifier">function</span>() {
<span class="lnr"> 3214 </span>    jQuery.valHooks[ <span class="Type">this</span> ] = jQuery.extend( jQuery.valHooks[ <span class="Type">this</span> ], {
<span class="lnr"> 3215 </span>       <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value ) {
<span class="lnr"> 3216 </span>          <span class="Statement">if</span> ( jQuery.isArray( value ) ) {
<span class="lnr"> 3217 </span>             <span class="Statement">return</span> ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) &gt;= <span class="Constant">0</span> );
<span class="lnr"> 3218 </span>          }
<span class="lnr"> 3219 </span>       }
<span class="lnr"> 3220 </span>    });
<span class="lnr"> 3221 </span>});
<span class="lnr"> 3222 </span><span class="Type">var</span> rformElems = <span class="Constant">/^(?:textarea|input|select)$/i</span>,
<span class="lnr"> 3223 </span>    rtypenamespace = <span class="Constant">/^([^</span><span class="Special">\.</span><span class="Constant">]*|)(?:</span><span class="Special">\.</span><span class="Constant">(.+)|)$/</span>,
<span class="lnr"> 3224 </span>    rhoverHack = <span class="Constant">/(?:^|</span><span class="Special">\s</span><span class="Constant">)hover(</span><span class="Special">\.\S</span><span class="Constant">+|)</span><span class="Special">\b</span><span class="Constant">/</span>,
<span class="lnr"> 3225 </span>    rkeyEvent = <span class="Constant">/^key/</span>,
<span class="lnr"> 3226 </span>    rmouseEvent = <span class="Constant">/^(?:mouse|contextmenu)|click/</span>,
<span class="lnr"> 3227 </span>    rfocusMorph = <span class="Constant">/^(?:focusinfocus|focusoutblur)$/</span>,
<span class="lnr"> 3228 </span>    hoverHack = <span class="Identifier">function</span>( events ) {
<span class="lnr"> 3229 </span>       <span class="Statement">return</span> jQuery.event.special.hover ? events : events.replace( rhoverHack, <span class="Constant">&quot;mouseenter$1 mouseleave$1&quot;</span> );
<span class="lnr"> 3230 </span>    };
<span class="lnr"> 3231 </span>
<span class="lnr"> 3232 </span><span class="Comment">/*</span>
<span class="lnr"> 3233 </span><span class="Comment"> * Helper functions for managing events -- not part of the public interface.</span>
<span class="lnr"> 3234 </span><span class="Comment"> * 处理事件的辅助函数,非公共接口的一部分</span>
<span class="lnr"> 3235 </span><span class="Comment"> * Props to Dean Edwards' addEvent library for many of the ideas.</span>
<span class="lnr"> 3236 </span><span class="Comment"> */</span>
<span class="lnr"> 3237 </span>jQuery.event = {
<span class="lnr"> 3238 </span>
<span class="lnr"> 3239 </span>    <span class="Statement">add</span>: <span class="Identifier">function</span>( elem, types, handler, data, selector ) {
<span class="lnr"> 3240 </span>
<span class="lnr"> 3241 </span>       <span class="Type">var</span> elemData, eventHandle, events,
<span class="lnr"> 3242 </span>          t, tns, type, namespaces, handleObj,
<span class="lnr"> 3243 </span>          handleObjIn, handlers, special;
<span class="lnr"> 3244 </span>
<span class="lnr"> 3245 </span><span class="Comment">       // Don't attach events to noData or text/comment nodes (allow plain objects tho)</span>
<span class="lnr"> 3246 </span><span class="Comment">       // 不附加没有数据的或者文本/注释节点</span>
<span class="lnr"> 3247 </span>       <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">3</span> || elem.nodeType === <span class="Constant">8</span> || !types || !handler || !(elemData = jQuery._data( elem )) ) {
<span class="lnr"> 3248 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3249 </span>       }
<span class="lnr"> 3250 </span>
<span class="lnr"> 3251 </span><span class="Comment">       // Caller can pass in an object of custom data in lieu of the handler</span>
<span class="lnr"> 3252 </span><span class="Comment">       // 调用者可以传入一个替代的数据对象</span>
<span class="lnr"> 3253 </span>       <span class="Statement">if</span> ( handler.handler ) {
<span class="lnr"> 3254 </span>          handleObjIn = handler;
<span class="lnr"> 3255 </span>          handler = handleObjIn.handler;
<span class="lnr"> 3256 </span>          selector = handleObjIn.selector;
<span class="lnr"> 3257 </span>       }
<span class="lnr"> 3258 </span>
<span class="lnr"> 3259 </span><span class="Comment">       // Make sure that the handler has a unique ID, used to find/remove it later</span>
<span class="lnr"> 3260 </span><span class="Comment">       // 保证处理器有一个唯一的ID,用来查找和移除该处理器</span>
<span class="lnr"> 3261 </span>       <span class="Statement">if</span> ( !handler.guid ) {
<span class="lnr"> 3262 </span>          handler.guid = jQuery.guid++;
<span class="lnr"> 3263 </span>       }
<span class="lnr"> 3264 </span>
<span class="lnr"> 3265 </span><span class="Comment">       // Init the element's event structure and main handler, if this is the first</span>
<span class="lnr"> 3266 </span><span class="Comment">       // 如果是第一次,初始化元素的事件数据结构和主要的处理器</span>
<span class="lnr"> 3267 </span>       events = elemData.events;
<span class="lnr"> 3268 </span>       <span class="Statement">if</span> ( !events ) {
<span class="lnr"> 3269 </span>          elemData.events = events = {};
<span class="lnr"> 3270 </span>       }
<span class="lnr"> 3271 </span>       eventHandle = elemData.handle;
<span class="lnr"> 3272 </span>       <span class="Statement">if</span> ( !eventHandle ) {
<span class="lnr"> 3273 </span>          elemData.handle = eventHandle = <span class="Identifier">function</span>( e ) {
<span class="lnr"> 3274 </span><span class="Comment">             // Discard the second event of a jQuery.event.trigger() and</span>
<span class="lnr"> 3275 </span><span class="Comment">             // 抛弃jQuery.event.trigger()触发的第二个事件和页面已经卸载后触发的事件</span>
<span class="lnr"> 3276 </span><span class="Comment">             // when an event is called after a page has unloaded</span>
<span class="lnr"> 3277 </span>             <span class="Statement">return</span> <span class="Statement">typeof</span> jQuery !== <span class="Constant">&quot;undefined&quot;</span> &amp;&amp; (!e || jQuery.event.triggered !== e.type) ?
<span class="lnr"> 3278 </span>                jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
<span class="lnr"> 3279 </span>                <span class="Type">undefined</span>;
<span class="lnr"> 3280 </span>          };
<span class="lnr"> 3281 </span><span class="Comment">          // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events</span>
<span class="lnr"> 3282 </span><span class="Comment">          // 元素作为处理器的属性,阻止非IE本地事件造成的内存溢出</span>
<span class="lnr"> 3283 </span>          eventHandle.elem = elem;
<span class="lnr"> 3284 </span>       }
<span class="lnr"> 3285 </span>
<span class="lnr"> 3286 </span><span class="Comment">       // Handle multiple events separated by a space</span>
<span class="lnr"> 3287 </span><span class="Comment">       // 处理使用空格分隔的多个事件名</span>
<span class="lnr"> 3288 </span><span class="Comment">       // jQuery(...).bind(&quot;mouseover mouseout&quot;, fn);</span>
<span class="lnr"> 3289 </span>       types = jQuery.trim( hoverHack(types) ).split( <span class="Constant">&quot; &quot;</span> );
<span class="lnr"> 3290 </span>       <span class="Statement">for</span> ( t = <span class="Constant">0</span>; t &lt; types.length; t++ ) {
<span class="lnr"> 3291 </span>
<span class="lnr"> 3292 </span>          tns = rtypenamespace.exec( types[t] ) || [];
<span class="lnr"> 3293 </span>          type = tns[<span class="Constant">1</span>];
<span class="lnr"> 3294 </span>          namespaces = ( tns[<span class="Constant">2</span>] || <span class="Constant">&quot;&quot;</span> ).split( <span class="Constant">&quot;.&quot;</span> ).sort();
<span class="lnr"> 3295 </span>
<span class="lnr"> 3296 </span><span class="Comment">          // If event changes its type, use the special event handlers for the changed type</span>
<span class="lnr"> 3297 </span><span class="Comment">          // 如果事件改变了类型,为改变类型使用特殊事件处理器</span>
<span class="lnr"> 3298 </span>          special = jQuery.event.special[ type ] || {};
<span class="lnr"> 3299 </span>
<span class="lnr"> 3300 </span><span class="Comment">          // If selector defined, determine special event api type, otherwise given type</span>
<span class="lnr"> 3301 </span><span class="Comment">          // 如果定义了选择器,决定特殊事件API类型,或者使用指定的类型</span>
<span class="lnr"> 3302 </span>          type = ( selector ? special.<span class="Statement">delegateType</span> : special.bindType ) || type;
<span class="lnr"> 3303 </span>
<span class="lnr"> 3304 </span><span class="Comment">          // Update special based on newly reset type</span>
<span class="lnr"> 3305 </span><span class="Comment">          // 根据重设的类型更新special</span>
<span class="lnr"> 3306 </span>          special = jQuery.event.special[ type ] || {};
<span class="lnr"> 3307 </span>
<span class="lnr"> 3308 </span><span class="Comment">          // handleObj is passed to all event handlers</span>
<span class="lnr"> 3309 </span><span class="Comment">          // 处理对象被传递给所有的事件处理器</span>
<span class="lnr"> 3310 </span>          handleObj = jQuery.extend({
<span class="lnr"> 3311 </span>             <span class="Statement">type</span>: type,
<span class="lnr"> 3312 </span>             <span class="Statement">origType</span>: tns[<span class="Constant">1</span>],
<span class="lnr"> 3313 </span>             <span class="Statement">data</span>: data,
<span class="lnr"> 3314 </span>             <span class="Statement">handler</span>: handler,
<span class="lnr"> 3315 </span>             <span class="Statement">guid</span>: handler.guid,
<span class="lnr"> 3316 </span>             <span class="Statement">selector</span>: selector,
<span class="lnr"> 3317 </span>             <span class="Statement">namespace</span>: namespaces.join(<span class="Constant">&quot;.&quot;</span>)
<span class="lnr"> 3318 </span>          }, handleObjIn );
<span class="lnr"> 3319 </span>
<span class="lnr"> 3320 </span><span class="Comment">          // Init the event handler queue if we're the first</span>
<span class="lnr"> 3321 </span><span class="Comment">          // 如果是第一次使用,初始化事件处理器队列</span>
<span class="lnr"> 3322 </span>          handlers = events[ type ];
<span class="lnr"> 3323 </span>          <span class="Statement">if</span> ( !handlers ) {
<span class="lnr"> 3324 </span>             handlers = events[ type ] = [];
<span class="lnr"> 3325 </span>             handlers.delegateCount = <span class="Constant">0</span>;
<span class="lnr"> 3326 </span>
<span class="lnr"> 3327 </span><span class="Comment">             // Only use addEventListener/attachEvent if the special events handler returns false</span>
<span class="lnr"> 3328 </span><span class="Comment">             // 如果特殊事件处理器返回false,只使用addEventListener/attachEvent</span>
<span class="lnr"> 3329 </span>             <span class="Statement">if</span> ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === <span class="Constant">false</span> ) {
<span class="lnr"> 3330 </span><span class="Comment">                // Bind the global event handler to the element</span>
<span class="lnr"> 3331 </span><span class="Comment">                // 给元素绑定全局的事件处理器</span>
<span class="lnr"> 3332 </span>                <span class="Statement">if</span> ( elem.addEventListener ) {
<span class="lnr"> 3333 </span>                   elem.addEventListener( type, eventHandle, <span class="Constant">false</span> );
<span class="lnr"> 3334 </span>
<span class="lnr"> 3335 </span>                } <span class="Statement">else</span> <span class="Statement">if</span> ( elem.attachEvent ) {
<span class="lnr"> 3336 </span>                   elem.attachEvent( <span class="Constant">&quot;on&quot;</span> + type, eventHandle );
<span class="lnr"> 3337 </span>                }
<span class="lnr"> 3338 </span>             }
<span class="lnr"> 3339 </span>          }
<span class="lnr"> 3340 </span>
<span class="lnr"> 3341 </span>          <span class="Statement">if</span> ( special.add ) {
<span class="lnr"> 3342 </span>             special.add.call( elem, handleObj );
<span class="lnr"> 3343 </span>
<span class="lnr"> 3344 </span>             <span class="Statement">if</span> ( !handleObj.handler.guid ) {
<span class="lnr"> 3345 </span>                handleObj.handler.guid = handler.guid;
<span class="lnr"> 3346 </span>             }
<span class="lnr"> 3347 </span>          }
<span class="lnr"> 3348 </span>
<span class="lnr"> 3349 </span><span class="Comment">          // Add to the element's handler list, delegates in front</span>
<span class="lnr"> 3350 </span><span class="Comment">          // 添加元素的处理器列表</span>
<span class="lnr"> 3351 </span>          <span class="Statement">if</span> ( selector ) {
<span class="lnr"> 3352 </span>             handlers.splice( handlers.delegateCount++, <span class="Constant">0</span>, handleObj );
<span class="lnr"> 3353 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 3354 </span>             handlers.push( handleObj );
<span class="lnr"> 3355 </span>          }
<span class="lnr"> 3356 </span>
<span class="lnr"> 3357 </span><span class="Comment">          // Keep track of which events have ever been used, for event optimization</span>
<span class="lnr"> 3358 </span><span class="Comment">          // 为了优化,跟踪哪一个事件被使用</span>
<span class="lnr"> 3359 </span>          jQuery.event.global[ type ] = <span class="Constant">true</span>;
<span class="lnr"> 3360 </span>       }
<span class="lnr"> 3361 </span>
<span class="lnr"> 3362 </span><span class="Comment">       // Nullify elem to prevent memory leaks in IE</span>
<span class="lnr"> 3363 </span><span class="Comment">       // 为了防止IE中内存泄露将elem设置为null</span>
<span class="lnr"> 3364 </span>       elem = <span class="Type">null</span>;
<span class="lnr"> 3365 </span>    },
<span class="lnr"> 3366 </span>
<span class="lnr"> 3367 </span>    <span class="Statement">global</span>: {},
<span class="lnr"> 3368 </span>
<span class="lnr"> 3369 </span><span class="Comment">    // Detach an event or set of events from an element</span>
<span class="lnr"> 3370 </span><span class="Comment">    // 从元素上移除事件</span>
<span class="lnr"> 3371 </span>    <span class="Statement">remove</span>: <span class="Identifier">function</span>( elem, types, handler, selector, mappedTypes ) {
<span class="lnr"> 3372 </span>
<span class="lnr"> 3373 </span>       <span class="Type">var</span> t, tns, type, origType, namespaces, origCount,
<span class="lnr"> 3374 </span>          j, events, special, eventType, handleObj,
<span class="lnr"> 3375 </span>          elemData = jQuery.hasData( elem ) &amp;&amp; jQuery._data( elem );
<span class="lnr"> 3376 </span>
<span class="lnr"> 3377 </span>       <span class="Statement">if</span> ( !elemData || !(events = elemData.events) ) {
<span class="lnr"> 3378 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3379 </span>       }
<span class="lnr"> 3380 </span>
<span class="lnr"> 3381 </span><span class="Comment">       // Once for each type.namespace in types; type may be omitted</span>
<span class="lnr"> 3382 </span>       types = jQuery.trim( hoverHack( types || <span class="Constant">&quot;&quot;</span> ) ).split(<span class="Constant">&quot; &quot;</span>);
<span class="lnr"> 3383 </span>       <span class="Statement">for</span> ( t = <span class="Constant">0</span>; t &lt; types.length; t++ ) {
<span class="lnr"> 3384 </span>          tns = rtypenamespace.exec( types[t] ) || [];
<span class="lnr"> 3385 </span>          type = origType = tns[<span class="Constant">1</span>];
<span class="lnr"> 3386 </span>          namespaces = tns[<span class="Constant">2</span>];
<span class="lnr"> 3387 </span>
<span class="lnr"> 3388 </span><span class="Comment">          // Unbind all events (on this namespace, if provided) for the element</span>
<span class="lnr"> 3389 </span><span class="Comment">          // 如果没有提供类型,移除该命名空间内(如果提供的话)该元素的所有绑定事件</span>
<span class="lnr"> 3390 </span>          <span class="Statement">if</span> ( !type ) {
<span class="lnr"> 3391 </span>             <span class="Statement">for</span> ( type <span class="Statement">in</span> events ) {
<span class="lnr"> 3392 </span>                jQuery.event.remove( elem, type + types[ t ], handler, selector, <span class="Constant">true</span> );
<span class="lnr"> 3393 </span>             }
<span class="lnr"> 3394 </span>             <span class="Statement">continue</span>;
<span class="lnr"> 3395 </span>          }
<span class="lnr"> 3396 </span>
<span class="lnr"> 3397 </span>          special = jQuery.event.special[ type ] || {};
<span class="lnr"> 3398 </span>          type = ( selector? special.<span class="Statement">delegateType</span> : special.bindType ) || type;
<span class="lnr"> 3399 </span>          eventType = events[ type ] || [];
<span class="lnr"> 3400 </span>          origCount = eventType.length;
<span class="lnr"> 3401 </span>          namespaces = namespaces ? <span class="Statement">new</span> <span class="Special">RegExp</span>(<span class="Constant">&quot;(^|</span><span class="Special">\\</span><span class="Constant">.)&quot;</span> + namespaces.split(<span class="Constant">&quot;.&quot;</span>).sort().join(<span class="Constant">&quot;</span><span class="Special">\\</span><span class="Constant">.(?:.*</span><span class="Special">\\</span><span class="Constant">.|)&quot;</span>) + <span class="Constant">&quot;(</span><span class="Special">\\</span><span class="Constant">.|$)&quot;</span>) : <span class="Type">null</span>;
<span class="lnr"> 3402 </span>
<span class="lnr"> 3403 </span><span class="Comment">          // Remove matching events</span>
<span class="lnr"> 3404 </span><span class="Comment">          // 移除匹配的事件</span>
<span class="lnr"> 3405 </span>          <span class="Statement">for</span> ( j = <span class="Constant">0</span>; j &lt; eventType.length; j++ ) {
<span class="lnr"> 3406 </span>             handleObj = eventType[ j ];
<span class="lnr"> 3407 </span>
<span class="lnr"> 3408 </span>             <span class="Statement">if</span> ( ( mappedTypes || origType === handleObj.origType ) &amp;&amp;
<span class="lnr"> 3409 </span>                 ( !handler || handler.guid === handleObj.guid ) &amp;&amp;
<span class="lnr"> 3410 </span>                 ( !namespaces || namespaces.test( handleObj.namespace ) ) &amp;&amp;
<span class="lnr"> 3411 </span>                 ( !selector || selector === handleObj.selector || selector === <span class="Constant">&quot;**&quot;</span> &amp;&amp; handleObj.selector ) ) {
<span class="lnr"> 3412 </span>                eventType.splice( j--, <span class="Constant">1</span> );
<span class="lnr"> 3413 </span>
<span class="lnr"> 3414 </span>                <span class="Statement">if</span> ( handleObj.selector ) {
<span class="lnr"> 3415 </span>                   eventType.delegateCount--;
<span class="lnr"> 3416 </span>                }
<span class="lnr"> 3417 </span>                <span class="Statement">if</span> ( special.remove ) {
<span class="lnr"> 3418 </span>                   special.remove.call( elem, handleObj );
<span class="lnr"> 3419 </span>                }
<span class="lnr"> 3420 </span>             }
<span class="lnr"> 3421 </span>          }
<span class="lnr"> 3422 </span>
<span class="lnr"> 3423 </span><span class="Comment">          // Remove generic event handler if we removed something and no more handlers exist</span>
<span class="lnr"> 3424 </span><span class="Comment">          // (avoids potential for endless recursion during removal of special event handlers)</span>
<span class="lnr"> 3425 </span>          <span class="Statement">if</span> ( eventType.length === <span class="Constant">0</span> &amp;&amp; origCount !== eventType.length ) {
<span class="lnr"> 3426 </span>             <span class="Statement">if</span> ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === <span class="Constant">false</span> ) {
<span class="lnr"> 3427 </span>                jQuery.removeEvent( elem, type, elemData.handle );
<span class="lnr"> 3428 </span>             }
<span class="lnr"> 3429 </span>
<span class="lnr"> 3430 </span>             <span class="Statement">delete</span> events[ type ];
<span class="lnr"> 3431 </span>          }
<span class="lnr"> 3432 </span>       }
<span class="lnr"> 3433 </span>
<span class="lnr"> 3434 </span><span class="Comment">       // Remove the expando if it's no longer used</span>
<span class="lnr"> 3435 </span><span class="Comment">       // 如果不再使用的话,移除标记</span>
<span class="lnr"> 3436 </span>       <span class="Statement">if</span> ( jQuery.isEmptyObject( events ) ) {
<span class="lnr"> 3437 </span>          <span class="Statement">delete</span> elemData.handle;
<span class="lnr"> 3438 </span>
<span class="lnr"> 3439 </span><span class="Comment">          // removeData also checks for emptiness and clears the expando if empty</span>
<span class="lnr"> 3440 </span><span class="Comment">          // so use it instead of delete</span>
<span class="lnr"> 3441 </span><span class="Comment">          // 使用removeData替代delete</span>
<span class="lnr"> 3442 </span>          jQuery.removeData( elem, <span class="Constant">&quot;events&quot;</span>, <span class="Constant">true</span> );
<span class="lnr"> 3443 </span>       }
<span class="lnr"> 3444 </span>    },
<span class="lnr"> 3445 </span>
<span class="lnr"> 3446 </span><span class="Comment">    // Events that are safe to short-circuit if no handlers are attached.</span>
<span class="lnr"> 3447 </span><span class="Comment">    // Native DOM events should not be added, they may have inline handlers.</span>
<span class="lnr"> 3448 </span><span class="Comment">    // 本地DOM事件不应该被添加,他们可能有内置的处理器</span>
<span class="lnr"> 3449 </span>    <span class="Statement">customEvent</span>: {
<span class="lnr"> 3450 </span>       <span class="Constant">&quot;getData&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 3451 </span>       <span class="Constant">&quot;setData&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 3452 </span>       <span class="Constant">&quot;changeData&quot;</span>: <span class="Constant">true</span>
<span class="lnr"> 3453 </span>    },
<span class="lnr"> 3454 </span>
<span class="lnr"> 3455 </span>    <span class="Statement">trigger</span>: <span class="Identifier">function</span>( event, data, elem, onlyHandlers ) {
<span class="lnr"> 3456 </span><span class="Comment">       // Don't do events on text and comment nodes</span>
<span class="lnr"> 3457 </span><span class="Comment">       // 不在文本和注释节点上处理事件</span>
<span class="lnr"> 3458 </span>       <span class="Statement">if</span> ( elem &amp;&amp; (elem.nodeType === <span class="Constant">3</span> || elem.nodeType === <span class="Constant">8</span>) ) {
<span class="lnr"> 3459 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3460 </span>       }
<span class="lnr"> 3461 </span>
<span class="lnr"> 3462 </span><span class="Comment">       // Event object or event type</span>
<span class="lnr"> 3463 </span><span class="Comment">       // 事件对象或者事件类型</span>
<span class="lnr"> 3464 </span>       <span class="Type">var</span> cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,
<span class="lnr"> 3465 </span>          type = event.type || event,
<span class="lnr"> 3466 </span>          namespaces = [];
<span class="lnr"> 3467 </span>
<span class="lnr"> 3468 </span><span class="Comment">       // focus/blur morphs to focusin/out; ensure we're not firing them right now</span>
<span class="lnr"> 3469 </span><span class="Comment">       // focus/blur焦点变形为focusin/out</span>
<span class="lnr"> 3470 </span>       <span class="Statement">if</span> ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
<span class="lnr"> 3471 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3472 </span>       }
<span class="lnr"> 3473 </span>
<span class="lnr"> 3474 </span>       <span class="Statement">if</span> ( type.indexOf( <span class="Constant">&quot;!&quot;</span> ) &gt;= <span class="Constant">0</span> ) {
<span class="lnr"> 3475 </span><span class="Comment">          // Exclusive events trigger only for the exact event (no namespaces)</span>
<span class="lnr"> 3476 </span><span class="Comment">          // 已明确的事件特有的事件触发器</span>
<span class="lnr"> 3477 </span>          type = type.slice(<span class="Constant">0</span>, -<span class="Constant">1</span>);
<span class="lnr"> 3478 </span>          exclusive = <span class="Constant">true</span>;
<span class="lnr"> 3479 </span>       }
<span class="lnr"> 3480 </span>
<span class="lnr"> 3481 </span>       <span class="Statement">if</span> ( type.indexOf( <span class="Constant">&quot;.&quot;</span> ) &gt;= <span class="Constant">0</span> ) {
<span class="lnr"> 3482 </span><span class="Comment">          // Namespaced trigger; create a regexp to match event type in handle()</span>
<span class="lnr"> 3483 </span><span class="Comment">          // 命名空间触发器；在处理方法中使用正则匹配事件类型</span>
<span class="lnr"> 3484 </span>          namespaces = type.split(<span class="Constant">&quot;.&quot;</span>);
<span class="lnr"> 3485 </span>          type = namespaces.shift();
<span class="lnr"> 3486 </span>          namespaces.sort();
<span class="lnr"> 3487 </span>       }
<span class="lnr"> 3488 </span>
<span class="lnr"> 3489 </span>       <span class="Statement">if</span> ( (!elem || jQuery.event.customEvent[ type ]) &amp;&amp; !jQuery.event.global[ type ] ) {
<span class="lnr"> 3490 </span><span class="Comment">          // No jQuery handlers for this event type, and it can't have inline handlers</span>
<span class="lnr"> 3491 </span><span class="Comment">          // jQuery不包含这个事件类型,返回</span>
<span class="lnr"> 3492 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3493 </span>       }
<span class="lnr"> 3494 </span>
<span class="lnr"> 3495 </span><span class="Comment">       // Caller can pass in an Event, Object, or just an event type string</span>
<span class="lnr"> 3496 </span><span class="Comment">       // 调用者可以传递一个Event,Object或者一个事件类型字符串</span>
<span class="lnr"> 3497 </span>       event = <span class="Statement">typeof</span> event === <span class="Constant">&quot;object&quot;</span> ?
<span class="lnr"> 3498 </span><span class="Comment">          // jQuery.Event object</span>
<span class="lnr"> 3499 </span>          event[ jQuery.expando ] ? event :
<span class="lnr"> 3500 </span><span class="Comment">          // Object literal</span>
<span class="lnr"> 3501 </span>          <span class="Statement">new</span> jQuery.Event( type, event ) :
<span class="lnr"> 3502 </span><span class="Comment">          // Just the event type (string)</span>
<span class="lnr"> 3503 </span>          <span class="Statement">new</span> jQuery.Event( type );
<span class="lnr"> 3504 </span>
<span class="lnr"> 3505 </span>       event.type = type;
<span class="lnr"> 3506 </span>       event.isTrigger = <span class="Constant">true</span>;
<span class="lnr"> 3507 </span>       event.exclusive = exclusive;
<span class="lnr"> 3508 </span>       event.namespace = namespaces.join( <span class="Constant">&quot;.&quot;</span> );
<span class="lnr"> 3509 </span>       event.namespace_re = event.namespace? <span class="Statement">new</span> <span class="Special">RegExp</span>(<span class="Constant">&quot;(^|</span><span class="Special">\\</span><span class="Constant">.)&quot;</span> + namespaces.join(<span class="Constant">&quot;</span><span class="Special">\\</span><span class="Constant">.(?:.*</span><span class="Special">\\</span><span class="Constant">.|)&quot;</span>) + <span class="Constant">&quot;(</span><span class="Special">\\</span><span class="Constant">.|$)&quot;</span>) : <span class="Type">null</span>;
<span class="lnr"> 3510 </span>       ontype = type.indexOf( <span class="Constant">&quot;:&quot;</span> ) &lt; <span class="Constant">0</span> ? <span class="Constant">&quot;on&quot;</span> + <span class="Statement">type</span> : <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 3511 </span>
<span class="lnr"> 3512 </span><span class="Comment">       // Handle a global trigger</span>
<span class="lnr"> 3513 </span><span class="Comment">       // 处理全局触发</span>
<span class="lnr"> 3514 </span>       <span class="Statement">if</span> ( !elem ) {
<span class="lnr"> 3515 </span>
<span class="lnr"> 3516 </span><span class="Comment">          // </span><span class="Todo">TODO</span><span class="Comment">: Stop taunting the data cache; remove global events and always attach to document</span>
<span class="lnr"> 3517 </span>          cache = jQuery.cache;
<span class="lnr"> 3518 </span>          <span class="Statement">for</span> ( i <span class="Statement">in</span> cache ) {
<span class="lnr"> 3519 </span>             <span class="Statement">if</span> ( cache[ i ].events &amp;&amp; cache[ i ].events[ type ] ) {
<span class="lnr"> 3520 </span>                jQuery.event.trigger( event, data, cache[ i ].handle.elem, <span class="Constant">true</span> );
<span class="lnr"> 3521 </span>             }
<span class="lnr"> 3522 </span>          }
<span class="lnr"> 3523 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3524 </span>       }
<span class="lnr"> 3525 </span>
<span class="lnr"> 3526 </span><span class="Comment">       // Clean up the event in case it is being reused</span>
<span class="lnr"> 3527 </span><span class="Comment">       // 清理事件,防止事件被重复使用</span>
<span class="lnr"> 3528 </span>       event.result = <span class="Type">undefined</span>;
<span class="lnr"> 3529 </span>       <span class="Statement">if</span> ( !event.target ) {
<span class="lnr"> 3530 </span>          event.target = elem;
<span class="lnr"> 3531 </span>       }
<span class="lnr"> 3532 </span>
<span class="lnr"> 3533 </span><span class="Comment">       // Clone any incoming data and prepend the event, creating the handler arg list</span>
<span class="lnr"> 3534 </span><span class="Comment">       // 复制任何输入数据,准备事件,创建处理器参数列表</span>
<span class="lnr"> 3535 </span>       data = data != <span class="Type">null</span> ? jQuery.makeArray( data ) : [];
<span class="lnr"> 3536 </span>       data.unshift( event );
<span class="lnr"> 3537 </span>
<span class="lnr"> 3538 </span><span class="Comment">       // Allow special events to draw outside the lines</span>
<span class="lnr"> 3539 </span>       special = jQuery.event.special[ type ] || {};
<span class="lnr"> 3540 </span>       <span class="Statement">if</span> ( special.trigger &amp;&amp; special.trigger.apply( elem, data ) === <span class="Constant">false</span> ) {
<span class="lnr"> 3541 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3542 </span>       }
<span class="lnr"> 3543 </span>
<span class="lnr"> 3544 </span><span class="Comment">       // Determine event propagation path in advance, per W3C events spec (#9951)</span>
<span class="lnr"> 3545 </span><span class="Comment">       // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)</span>
<span class="lnr"> 3546 </span><span class="Comment">       // 决定事件冒泡的路径</span>
<span class="lnr"> 3547 </span>       eventPath = [[ elem, special.bindType || type ]];
<span class="lnr"> 3548 </span>       <span class="Statement">if</span> ( !onlyHandlers &amp;&amp; !special.noBubble &amp;&amp; !jQuery.isWindow( elem ) ) {
<span class="lnr"> 3549 </span>
<span class="lnr"> 3550 </span>          bubbleType = special.delegateType || type;
<span class="lnr"> 3551 </span>          cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
<span class="lnr"> 3552 </span>          <span class="Statement">for</span> ( old = elem; cur; cur = cur.parentNode ) {
<span class="lnr"> 3553 </span>             eventPath.push([ cur, bubbleType ]);
<span class="lnr"> 3554 </span>             old = cur;
<span class="lnr"> 3555 </span>          }
<span class="lnr"> 3556 </span>
<span class="lnr"> 3557 </span><span class="Comment">          // Only add window if we got to document (e.g., not plain obj or detached DOM)</span>
<span class="lnr"> 3558 </span>          <span class="Statement">if</span> ( old === (elem.ownerDocument || document) ) {
<span class="lnr"> 3559 </span>             eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
<span class="lnr"> 3560 </span>          }
<span class="lnr"> 3561 </span>       }
<span class="lnr"> 3562 </span>
<span class="lnr"> 3563 </span><span class="Comment">       // Fire handlers on the event path</span>
<span class="lnr"> 3564 </span><span class="Comment">       // 触发事件路径上的处理器</span>
<span class="lnr"> 3565 </span>       <span class="Statement">for</span> ( i = <span class="Constant">0</span>; i &lt; eventPath.length &amp;&amp; !event.isPropagationStopped(); i++ ) {
<span class="lnr"> 3566 </span>
<span class="lnr"> 3567 </span>          cur = eventPath[i][<span class="Constant">0</span>];
<span class="lnr"> 3568 </span>          event.type = eventPath[i][<span class="Constant">1</span>];
<span class="lnr"> 3569 </span>
<span class="lnr"> 3570 </span>          handle = ( jQuery._data( cur, <span class="Constant">&quot;events&quot;</span> ) || {} )[ event.type ] &amp;&amp; jQuery._data( cur, <span class="Constant">&quot;handle&quot;</span> );
<span class="lnr"> 3571 </span>          <span class="Statement">if</span> ( handle ) {
<span class="lnr"> 3572 </span>             handle.apply( cur, data );
<span class="lnr"> 3573 </span>          }
<span class="lnr"> 3574 </span><span class="Comment">          // Note that this is a bare JS function and not a jQuery handler</span>
<span class="lnr"> 3575 </span><span class="Comment">          // 这是JS函数,不是jQuery处理器</span>
<span class="lnr"> 3576 </span>          handle = ontype &amp;&amp; cur[ ontype ];
<span class="lnr"> 3577 </span>          <span class="Statement">if</span> ( handle &amp;&amp; jQuery.acceptData( cur ) &amp;&amp; handle.apply( cur, data ) === <span class="Constant">false</span> ) {
<span class="lnr"> 3578 </span>             event.preventDefault();
<span class="lnr"> 3579 </span>          }
<span class="lnr"> 3580 </span>       }
<span class="lnr"> 3581 </span>       event.type = type;
<span class="lnr"> 3582 </span>
<span class="lnr"> 3583 </span><span class="Comment">       // If nobody prevented the default action, do it now</span>
<span class="lnr"> 3584 </span><span class="Comment">       // 如果默认行为没有被阻止,阻止该行为</span>
<span class="lnr"> 3585 </span>       <span class="Statement">if</span> ( !onlyHandlers &amp;&amp; !event.isDefaultPrevented() ) {
<span class="lnr"> 3586 </span>
<span class="lnr"> 3587 </span>          <span class="Statement">if</span> ( (!special._default || special._default.apply( elem.ownerDocument, data ) === <span class="Constant">false</span>) &amp;&amp;
<span class="lnr"> 3588 </span>             !(type === <span class="Constant">&quot;click&quot;</span> &amp;&amp; jQuery.nodeName( elem, <span class="Constant">&quot;a&quot;</span> )) &amp;&amp; jQuery.acceptData( elem ) ) {
<span class="lnr"> 3589 </span>
<span class="lnr"> 3590 </span><span class="Comment">             // Call a native DOM method on the target with the same name name as the event.</span>
<span class="lnr"> 3591 </span><span class="Comment">             // 使用相同的事件名在目标上调用本地DOM方法</span>
<span class="lnr"> 3592 </span><span class="Comment">             // Can't use an .isFunction() check here because IE6/7 fails that test.</span>
<span class="lnr"> 3593 </span><span class="Comment">             // 不能使用.isFunction()进行检查,因为IE6/7无法通过该测试</span>
<span class="lnr"> 3594 </span><span class="Comment">             // Don't do default actions on window, that's where global variables be (#6170)</span>
<span class="lnr"> 3595 </span><span class="Comment">             // 不能在window上触发默认行为,window是全局变量被保存的地方</span>
<span class="lnr"> 3596 </span><span class="Comment">             // IE&lt;9 dies on focus/blur to hidden element (#1486)</span>
<span class="lnr"> 3597 </span><span class="Comment">             // 当focus/blur隐藏元素时,IE9会挂</span>
<span class="lnr"> 3598 </span>             <span class="Statement">if</span> ( ontype &amp;&amp; elem[ type ] &amp;&amp; ((type !== <span class="Constant">&quot;focus&quot;</span> &amp;&amp; type !== <span class="Constant">&quot;blur&quot;</span>) || event.target.offsetWidth !== <span class="Constant">0</span>) &amp;&amp; !jQuery.isWindow( elem ) ) {
<span class="lnr"> 3599 </span>
<span class="lnr"> 3600 </span><span class="Comment">                // Don't re-trigger an onFOO event when we call its FOO() method</span>
<span class="lnr"> 3601 </span><span class="Comment">                // 当调用Foo()时,不再触发onFoo()</span>
<span class="lnr"> 3602 </span>                old = elem[ ontype ];
<span class="lnr"> 3603 </span>
<span class="lnr"> 3604 </span>                <span class="Statement">if</span> ( old ) {
<span class="lnr"> 3605 </span>                   elem[ ontype ] = <span class="Type">null</span>;
<span class="lnr"> 3606 </span>                }
<span class="lnr"> 3607 </span>
<span class="lnr"> 3608 </span><span class="Comment">                // Prevent re-triggering of the same event, since we already bubbled it above</span>
<span class="lnr"> 3609 </span><span class="Comment">                // 已经把事件冒泡后,阻止触发同样的事件</span>
<span class="lnr"> 3610 </span>                jQuery.event.triggered = type;
<span class="lnr"> 3611 </span>                elem[ type ]();
<span class="lnr"> 3612 </span>                jQuery.event.triggered = <span class="Type">undefined</span>;
<span class="lnr"> 3613 </span>
<span class="lnr"> 3614 </span>                <span class="Statement">if</span> ( old ) {
<span class="lnr"> 3615 </span>                   elem[ ontype ] = old;
<span class="lnr"> 3616 </span>                }
<span class="lnr"> 3617 </span>             }
<span class="lnr"> 3618 </span>          }
<span class="lnr"> 3619 </span>       }
<span class="lnr"> 3620 </span>
<span class="lnr"> 3621 </span>       <span class="Statement">return</span> event.result;
<span class="lnr"> 3622 </span>    },
<span class="lnr"> 3623 </span>
<span class="lnr"> 3624 </span>    <span class="Statement">dispatch</span>: <span class="Identifier">function</span>( event ) {
<span class="lnr"> 3625 </span>
<span class="lnr"> 3626 </span><span class="Comment">       // Make a writable jQuery.Event from the native event object</span>
<span class="lnr"> 3627 </span><span class="Comment">       // 使用本地事件对象构造一个可编辑的jQuery.Event</span>
<span class="lnr"> 3628 </span>       event = jQuery.event.fix( event || window.event );
<span class="lnr"> 3629 </span>
<span class="lnr"> 3630 </span>       <span class="Type">var</span> i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
<span class="lnr"> 3631 </span>          handlers = ( (jQuery._data( <span class="Type">this</span>, <span class="Constant">&quot;events&quot;</span> ) || {} )[ event.type ] || []),
<span class="lnr"> 3632 </span>          delegateCount = handlers.delegateCount,
<span class="lnr"> 3633 </span>          args = [].slice.call( arguments ),
<span class="lnr"> 3634 </span>          run_all = !event.exclusive &amp;&amp; !event.namespace,
<span class="lnr"> 3635 </span>          special = jQuery.event.special[ event.type ] || {},
<span class="lnr"> 3636 </span>          handlerQueue = [];
<span class="lnr"> 3637 </span>
<span class="lnr"> 3638 </span><span class="Comment">       // Use the fix-ed jQuery.Event rather than the (read-only) native event</span>
<span class="lnr"> 3639 </span><span class="Comment">       // 使用修复的jQuery.Event,不适用只读的本地事件对象</span>
<span class="lnr"> 3640 </span>       args[<span class="Constant">0</span>] = event;
<span class="lnr"> 3641 </span>       event.delegateTarget = <span class="Type">this</span>;
<span class="lnr"> 3642 </span>
<span class="lnr"> 3643 </span><span class="Comment">       // Call the preDispatch hook for the mapped type, and let it bail if desired</span>
<span class="lnr"> 3644 </span><span class="Comment">       // 调用绑定类型的前置分发钩子,如果需要,可以先执行</span>
<span class="lnr"> 3645 </span>       <span class="Statement">if</span> ( special.preDispatch &amp;&amp; special.preDispatch.call( <span class="Type">this</span>, event ) === <span class="Constant">false</span> ) {
<span class="lnr"> 3646 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3647 </span>       }
<span class="lnr"> 3648 </span>
<span class="lnr"> 3649 </span><span class="Comment">       // Determine handlers that should run if there are delegated events</span>
<span class="lnr"> 3650 </span><span class="Comment">       // 如果有代理事件的话,决定需要执行的处理器</span>
<span class="lnr"> 3651 </span><span class="Comment">       // Avoid non-left-click bubbling in Firefox (#3861)</span>
<span class="lnr"> 3652 </span>       <span class="Statement">if</span> ( delegateCount &amp;&amp; !(event.button &amp;&amp; event.type === <span class="Constant">&quot;click&quot;</span>) ) {
<span class="lnr"> 3653 </span>
<span class="lnr"> 3654 </span>          <span class="Statement">for</span> ( cur = event.target; cur != <span class="Type">this</span>; cur = cur.parentNode || <span class="Type">this</span> ) {
<span class="lnr"> 3655 </span>
<span class="lnr"> 3656 </span><span class="Comment">             // Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)</span>
<span class="lnr"> 3657 </span><span class="Comment">             // 不处理无效元素上的单击事件</span>
<span class="lnr"> 3658 </span>             <span class="Statement">if</span> ( cur.disabled !== <span class="Constant">true</span> || event.type !== <span class="Constant">&quot;click&quot;</span> ) {
<span class="lnr"> 3659 </span>                selMatch = {};
<span class="lnr"> 3660 </span>                matches = [];
<span class="lnr"> 3661 </span>                <span class="Statement">for</span> ( i = <span class="Constant">0</span>; i &lt; delegateCount; i++ ) {
<span class="lnr"> 3662 </span>                   handleObj = handlers[ i ];
<span class="lnr"> 3663 </span>                   sel = handleObj.selector;
<span class="lnr"> 3664 </span>
<span class="lnr"> 3665 </span>                   <span class="Statement">if</span> ( selMatch[ sel ] === <span class="Type">undefined</span> ) {
<span class="lnr"> 3666 </span>                      selMatch[ sel ] = jQuery( sel, <span class="Type">this</span> ).index( cur ) &gt;= <span class="Constant">0</span>;
<span class="lnr"> 3667 </span>                   }
<span class="lnr"> 3668 </span>                   <span class="Statement">if</span> ( selMatch[ sel ] ) {
<span class="lnr"> 3669 </span>                      matches.push( handleObj );
<span class="lnr"> 3670 </span>                   }
<span class="lnr"> 3671 </span>                }
<span class="lnr"> 3672 </span>                <span class="Statement">if</span> ( matches.length ) {
<span class="lnr"> 3673 </span>                   handlerQueue.push({ <span class="Statement">elem</span>: cur, <span class="Statement">matches</span>: matches });
<span class="lnr"> 3674 </span>                }
<span class="lnr"> 3675 </span>             }
<span class="lnr"> 3676 </span>          }
<span class="lnr"> 3677 </span>       }
<span class="lnr"> 3678 </span>
<span class="lnr"> 3679 </span><span class="Comment">       // Add the remaining (directly-bound) handlers</span>
<span class="lnr"> 3680 </span><span class="Comment">       // 添加剩余的处理器</span>
<span class="lnr"> 3681 </span>       <span class="Statement">if</span> ( handlers.length &gt; delegateCount ) {
<span class="lnr"> 3682 </span>          handlerQueue.push({ <span class="Statement">elem</span>: <span class="Type">this</span>, <span class="Statement">matches</span>: handlers.slice( delegateCount ) });
<span class="lnr"> 3683 </span>       }
<span class="lnr"> 3684 </span>
<span class="lnr"> 3685 </span><span class="Comment">       // Run delegates first; they may want to stop propagation beneath us</span>
<span class="lnr"> 3686 </span><span class="Comment">       // 先运行代理,可能希望在我们的机制之前停止冒泡</span>
<span class="lnr"> 3687 </span>       <span class="Statement">for</span> ( i = <span class="Constant">0</span>; i &lt; handlerQueue.length &amp;&amp; !event.isPropagationStopped(); i++ ) {
<span class="lnr"> 3688 </span>          matched = handlerQueue[ i ];
<span class="lnr"> 3689 </span>          event.currentTarget = matched.elem;
<span class="lnr"> 3690 </span>
<span class="lnr"> 3691 </span>          <span class="Statement">for</span> ( j = <span class="Constant">0</span>; j &lt; matched.matches.length &amp;&amp; !event.isImmediatePropagationStopped(); j++ ) {
<span class="lnr"> 3692 </span>             handleObj = matched.matches[ j ];
<span class="lnr"> 3693 </span>
<span class="lnr"> 3694 </span><span class="Comment">             // Triggered event must either 1) be non-exclusive and have no namespace, or</span>
<span class="lnr"> 3695 </span><span class="Comment">             // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).</span>
<span class="lnr"> 3696 </span>             <span class="Statement">if</span> ( run_all || (!event.namespace &amp;&amp; !handleObj.namespace) || event.namespace_re &amp;&amp; event.namespace_re.test( handleObj.namespace ) ) {
<span class="lnr"> 3697 </span>
<span class="lnr"> 3698 </span>                event.data = handleObj.data;
<span class="lnr"> 3699 </span>                event.handleObj = handleObj;
<span class="lnr"> 3700 </span>
<span class="lnr"> 3701 </span>                ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
<span class="lnr"> 3702 </span>                      .apply( matched.elem, args );
<span class="lnr"> 3703 </span>
<span class="lnr"> 3704 </span>                <span class="Statement">if</span> ( ret !== <span class="Type">undefined</span> ) {
<span class="lnr"> 3705 </span>                   event.result = ret;
<span class="lnr"> 3706 </span>                   <span class="Statement">if</span> ( ret === <span class="Constant">false</span> ) {
<span class="lnr"> 3707 </span>                      event.preventDefault();
<span class="lnr"> 3708 </span>                      event.stopPropagation();
<span class="lnr"> 3709 </span>                   }
<span class="lnr"> 3710 </span>                }
<span class="lnr"> 3711 </span>             }
<span class="lnr"> 3712 </span>          }
<span class="lnr"> 3713 </span>       }
<span class="lnr"> 3714 </span>
<span class="lnr"> 3715 </span><span class="Comment">       // Call the postDispatch hook for the mapped type</span>
<span class="lnr"> 3716 </span>       <span class="Statement">if</span> ( special.postDispatch ) {
<span class="lnr"> 3717 </span>          special.postDispatch.call( <span class="Type">this</span>, event );
<span class="lnr"> 3718 </span>       }
<span class="lnr"> 3719 </span>
<span class="lnr"> 3720 </span>       <span class="Statement">return</span> event.result;
<span class="lnr"> 3721 </span>    },
<span class="lnr"> 3722 </span>
<span class="lnr"> 3723 </span><span class="Comment">    // Includes some event props shared by KeyEvent and MouseEvent</span>
<span class="lnr"> 3724 </span><span class="Comment">    // 包含一些键盘和鼠标事件属性</span>
<span class="lnr"> 3725 </span><span class="Comment">    // *** attrChange attrName relatedNode srcElement  are not normalized, non-W3C, deprecated, will be removed in 1.8 ***</span>
<span class="lnr"> 3726 </span>    <span class="Statement">props</span>: <span class="Constant">&quot;attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which&quot;</span>.split(<span class="Constant">&quot; &quot;</span>),
<span class="lnr"> 3727 </span>
<span class="lnr"> 3728 </span>    <span class="Statement">fixHooks</span>: {},
<span class="lnr"> 3729 </span>
<span class="lnr"> 3730 </span><span class="Comment">    // 键盘事件钩子</span>
<span class="lnr"> 3731 </span>    <span class="Statement">keyHooks</span>: {
<span class="lnr"> 3732 </span>       <span class="Statement">props</span>: <span class="Constant">&quot;char charCode key keyCode&quot;</span>.split(<span class="Constant">&quot; &quot;</span>),
<span class="lnr"> 3733 </span>       <span class="Statement">filter</span>: <span class="Identifier">function</span>( event, original ) {
<span class="lnr"> 3734 </span>
<span class="lnr"> 3735 </span><span class="Comment">          // Add which for key events</span>
<span class="lnr"> 3736 </span>          <span class="Statement">if</span> ( event.which == <span class="Type">null</span> ) {
<span class="lnr"> 3737 </span>             event.which = original.charCode != <span class="Type">null</span> ? original.<span class="Statement">charCode</span> : original.keyCode;
<span class="lnr"> 3738 </span>          }
<span class="lnr"> 3739 </span>
<span class="lnr"> 3740 </span>          <span class="Statement">return</span> event;
<span class="lnr"> 3741 </span>       }
<span class="lnr"> 3742 </span>    },
<span class="lnr"> 3743 </span>
<span class="lnr"> 3744 </span><span class="Comment">    // 鼠标事件钩子</span>
<span class="lnr"> 3745 </span>    <span class="Statement">mouseHooks</span>: {
<span class="lnr"> 3746 </span>       <span class="Statement">props</span>: <span class="Constant">&quot;button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement&quot;</span>.split(<span class="Constant">&quot; &quot;</span>),
<span class="lnr"> 3747 </span>       <span class="Statement">filter</span>: <span class="Identifier">function</span>( event, original ) {
<span class="lnr"> 3748 </span>          <span class="Type">var</span> eventDoc, doc, body,
<span class="lnr"> 3749 </span>             button = original.button,
<span class="lnr"> 3750 </span>             fromElement = original.fromElement;
<span class="lnr"> 3751 </span>
<span class="lnr"> 3752 </span><span class="Comment">          // Calculate pageX/Y if missing and clientX/Y available</span>
<span class="lnr"> 3753 </span>          <span class="Statement">if</span> ( event.pageX == <span class="Type">null</span> &amp;&amp; original.clientX != <span class="Type">null</span> ) {
<span class="lnr"> 3754 </span>             eventDoc = event.target.ownerDocument || document;
<span class="lnr"> 3755 </span>             doc = eventDoc.documentElement;
<span class="lnr"> 3756 </span>             body = eventDoc.body;
<span class="lnr"> 3757 </span>
<span class="lnr"> 3758 </span>             event.pageX = original.clientX + ( doc &amp;&amp; doc.scrollLeft || body &amp;&amp; body.scrollLeft || <span class="Constant">0</span> ) - ( doc &amp;&amp; doc.clientLeft || body &amp;&amp; body.clientLeft || <span class="Constant">0</span> );
<span class="lnr"> 3759 </span>             event.pageY = original.clientY + ( doc &amp;&amp; doc.scrollTop  || body &amp;&amp; body.scrollTop  || <span class="Constant">0</span> ) - ( doc &amp;&amp; doc.clientTop  || body &amp;&amp; body.clientTop  || <span class="Constant">0</span> );
<span class="lnr"> 3760 </span>          }
<span class="lnr"> 3761 </span>
<span class="lnr"> 3762 </span><span class="Comment">          // Add relatedTarget, if necessary</span>
<span class="lnr"> 3763 </span><span class="Comment">          // 如果需要,添加关联目标</span>
<span class="lnr"> 3764 </span>          <span class="Statement">if</span> ( !event.relatedTarget &amp;&amp; fromElement ) {
<span class="lnr"> 3765 </span>             event.relatedTarget = fromElement === event.target ? original.<span class="Statement">toElement</span> : fromElement;
<span class="lnr"> 3766 </span>          }
<span class="lnr"> 3767 </span>
<span class="lnr"> 3768 </span><span class="Comment">          // Add which for click: 1 === left; 2 === middle; 3 === right</span>
<span class="lnr"> 3769 </span><span class="Comment">          // Note: button is not normalized, so don't use it</span>
<span class="lnr"> 3770 </span><span class="Comment">          // button并不标准,不要使用</span>
<span class="lnr"> 3771 </span>          <span class="Statement">if</span> ( !event.which &amp;&amp; button !== <span class="Type">undefined</span> ) {
<span class="lnr"> 3772 </span>             event.which = ( button &amp; <span class="Constant">1</span> ? <span class="Constant">1</span> : ( button &amp; <span class="Constant">2</span> ? <span class="Constant">3</span> : ( button &amp; <span class="Constant">4</span> ? <span class="Constant">2</span> : <span class="Constant">0</span> ) ) );
<span class="lnr"> 3773 </span>          }
<span class="lnr"> 3774 </span>
<span class="lnr"> 3775 </span>          <span class="Statement">return</span> event;
<span class="lnr"> 3776 </span>       }
<span class="lnr"> 3777 </span>    },
<span class="lnr"> 3778 </span>
<span class="lnr"> 3779 </span>    <span class="Statement">fix</span>: <span class="Identifier">function</span>( event ) {
<span class="lnr"> 3780 </span>       <span class="Statement">if</span> ( event[ jQuery.expando ] ) {
<span class="lnr"> 3781 </span>          <span class="Statement">return</span> event;
<span class="lnr"> 3782 </span>       }
<span class="lnr"> 3783 </span>
<span class="lnr"> 3784 </span><span class="Comment">       // Create a writable copy of the event object and normalize some properties</span>
<span class="lnr"> 3785 </span><span class="Comment">       // 创建一个事件对象的可编辑副本,并且初始化一些属性</span>
<span class="lnr"> 3786 </span>       <span class="Type">var</span> i, prop,
<span class="lnr"> 3787 </span>          originalEvent = event,
<span class="lnr"> 3788 </span>          fixHook = jQuery.event.fixHooks[ event.type ] || {},
<span class="lnr"> 3789 </span>          copy = fixHook.props ? <span class="Type">this</span>.props.concat( fixHook.props ) : <span class="Type">this</span>.props;
<span class="lnr"> 3790 </span>
<span class="lnr"> 3791 </span>       event = jQuery.Event( originalEvent );
<span class="lnr"> 3792 </span>
<span class="lnr"> 3793 </span>       <span class="Statement">for</span> ( i = copy.length; i; ) {
<span class="lnr"> 3794 </span>          prop = copy[ --i ];
<span class="lnr"> 3795 </span>          event[ prop ] = originalEvent[ prop ];
<span class="lnr"> 3796 </span>       }
<span class="lnr"> 3797 </span>
<span class="lnr"> 3798 </span><span class="Comment">       // Fix target property, if necessary (#1925, IE 6/7/8 &amp; Safari2)</span>
<span class="lnr"> 3799 </span><span class="Comment">       // 修正目标属性</span>
<span class="lnr"> 3800 </span>       <span class="Statement">if</span> ( !event.target ) {
<span class="lnr"> 3801 </span>          event.target = originalEvent.srcElement || document;
<span class="lnr"> 3802 </span>       }
<span class="lnr"> 3803 </span>
<span class="lnr"> 3804 </span><span class="Comment">       // Target should not be a text node (#504, Safari)</span>
<span class="lnr"> 3805 </span><span class="Comment">       // 目标不能是一个文本节点</span>
<span class="lnr"> 3806 </span>       <span class="Statement">if</span> ( event.target.nodeType === <span class="Constant">3</span> ) {
<span class="lnr"> 3807 </span>          event.target = event.target.parentNode;
<span class="lnr"> 3808 </span>       }
<span class="lnr"> 3809 </span>
<span class="lnr"> 3810 </span><span class="Comment">       // For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)</span>
<span class="lnr"> 3811 </span><span class="Comment">       // 鼠标/键盘事件,如果metaKey没有定义的话,设置为fasle</span>
<span class="lnr"> 3812 </span>       event.metaKey = !!event.metaKey;
<span class="lnr"> 3813 </span>
<span class="lnr"> 3814 </span>       <span class="Statement">return</span> fixHook.filter? fixHook.filter( event, originalEvent ) : event;
<span class="lnr"> 3815 </span>    },
<span class="lnr"> 3816 </span>
<span class="lnr"> 3817 </span>    <span class="Statement">special</span>: {
<span class="lnr"> 3818 </span>       <span class="Statement">load</span>: {
<span class="lnr"> 3819 </span><span class="Comment">          // Prevent triggered image.load events from bubbling to window.load</span>
<span class="lnr"> 3820 </span><span class="Comment">          // 阻止触发image.load事件冒泡到window.load</span>
<span class="lnr"> 3821 </span>          <span class="Statement">noBubble</span>: <span class="Constant">true</span>
<span class="lnr"> 3822 </span>       },
<span class="lnr"> 3823 </span>
<span class="lnr"> 3824 </span>       <span class="Statement">focus</span>: {
<span class="lnr"> 3825 </span>          <span class="Statement">delegateType</span>: <span class="Constant">&quot;focusin&quot;</span>
<span class="lnr"> 3826 </span>       },
<span class="lnr"> 3827 </span>       <span class="Statement">blur</span>: {
<span class="lnr"> 3828 </span>          <span class="Statement">delegateType</span>: <span class="Constant">&quot;focusout&quot;</span>
<span class="lnr"> 3829 </span>       },
<span class="lnr"> 3830 </span>
<span class="lnr"> 3831 </span>       <span class="Statement">beforeunload</span>: {
<span class="lnr"> 3832 </span>          <span class="Statement">setup</span>: <span class="Identifier">function</span>( data, namespaces, eventHandle ) {
<span class="lnr"> 3833 </span><span class="Comment">             // We only want to do this special case on windows</span>
<span class="lnr"> 3834 </span><span class="Comment">             // 只在window上执行该操作</span>
<span class="lnr"> 3835 </span>             <span class="Statement">if</span> ( jQuery.isWindow( <span class="Type">this</span> ) ) {
<span class="lnr"> 3836 </span>                <span class="Type">this</span>.onbeforeunload = eventHandle;
<span class="lnr"> 3837 </span>             }
<span class="lnr"> 3838 </span>          },
<span class="lnr"> 3839 </span>
<span class="lnr"> 3840 </span>          <span class="Statement">teardown</span>: <span class="Identifier">function</span>( namespaces, eventHandle ) {
<span class="lnr"> 3841 </span>             <span class="Statement">if</span> ( <span class="Type">this</span>.onbeforeunload === eventHandle ) {
<span class="lnr"> 3842 </span>                <span class="Type">this</span>.onbeforeunload = <span class="Type">null</span>;
<span class="lnr"> 3843 </span>             }
<span class="lnr"> 3844 </span>          }
<span class="lnr"> 3845 </span>       }
<span class="lnr"> 3846 </span>    },
<span class="lnr"> 3847 </span>
<span class="lnr"> 3848 </span>    <span class="Statement">simulate</span>: <span class="Identifier">function</span>( type, elem, event, bubble ) {
<span class="lnr"> 3849 </span><span class="Comment">       // Piggyback on a donor event to simulate a different one.</span>
<span class="lnr"> 3850 </span><span class="Comment">       // Fake originalEvent to avoid donor's stopPropagation, but if the</span>
<span class="lnr"> 3851 </span><span class="Comment">       // simulated event prevents default then we do the same on the donor.</span>
<span class="lnr"> 3852 </span>       <span class="Type">var</span> e = jQuery.extend(
<span class="lnr"> 3853 </span>          <span class="Statement">new</span> jQuery.Event(),
<span class="lnr"> 3854 </span>          event,
<span class="lnr"> 3855 </span>          { <span class="Statement">type</span>: type,
<span class="lnr"> 3856 </span>             <span class="Statement">isSimulated</span>: <span class="Constant">true</span>,
<span class="lnr"> 3857 </span>             <span class="Statement">originalEvent</span>: {}
<span class="lnr"> 3858 </span>          }
<span class="lnr"> 3859 </span>       );
<span class="lnr"> 3860 </span>       <span class="Statement">if</span> ( bubble ) {
<span class="lnr"> 3861 </span>          jQuery.event.trigger( e, <span class="Type">null</span>, elem );
<span class="lnr"> 3862 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 3863 </span>          jQuery.event.dispatch.call( elem, e );
<span class="lnr"> 3864 </span>       }
<span class="lnr"> 3865 </span>       <span class="Statement">if</span> ( e.isDefaultPrevented() ) {
<span class="lnr"> 3866 </span>          event.preventDefault();
<span class="lnr"> 3867 </span>       }
<span class="lnr"> 3868 </span>    }
<span class="lnr"> 3869 </span>};
<span class="lnr"> 3870 </span>
<span class="lnr"> 3871 </span><span class="Comment">// Some plugins are using, but it's undocumented/deprecated and will be removed.</span>
<span class="lnr"> 3872 </span><span class="Comment">// 一些插件在用,但是是没有归档/过时的,将来会被移除</span>
<span class="lnr"> 3873 </span><span class="Comment">// The 1.7 special event interface should provide all the hooks needed now.</span>
<span class="lnr"> 3874 </span><span class="Comment">// 1.7版本中的special事件接口会提供所有需要的钩子</span>
<span class="lnr"> 3875 </span>jQuery.event.handle = jQuery.event.dispatch;
<span class="lnr"> 3876 </span>
<span class="lnr"> 3877 </span>jQuery.removeEvent = document.removeEventListener ?
<span class="lnr"> 3878 </span>    <span class="Identifier">function</span>( elem, type, handle ) {
<span class="lnr"> 3879 </span>       <span class="Statement">if</span> ( elem.removeEventListener ) {
<span class="lnr"> 3880 </span>          elem.removeEventListener( type, handle, <span class="Constant">false</span> );
<span class="lnr"> 3881 </span>       }
<span class="lnr"> 3882 </span>    } :
<span class="lnr"> 3883 </span>    <span class="Identifier">function</span>( elem, type, handle ) {
<span class="lnr"> 3884 </span>       <span class="Type">var</span> name = <span class="Constant">&quot;on&quot;</span> + type;
<span class="lnr"> 3885 </span>
<span class="lnr"> 3886 </span>       <span class="Statement">if</span> ( elem.detachEvent ) {
<span class="lnr"> 3887 </span>
<span class="lnr"> 3888 </span><span class="Comment">          // #8545, #7054, preventing memory leaks for custom events in IE6-8 –</span>
<span class="lnr"> 3889 </span><span class="Comment">          // detachEvent needed property on element, by name of that event, to properly expose it to GC</span>
<span class="lnr"> 3890 </span><span class="Comment">          // 防止内存泄露</span>
<span class="lnr"> 3891 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem[ name ] === <span class="Constant">&quot;undefined&quot;</span> ) {
<span class="lnr"> 3892 </span>             elem[ name ] = <span class="Type">null</span>;
<span class="lnr"> 3893 </span>          }
<span class="lnr"> 3894 </span>
<span class="lnr"> 3895 </span>          elem.detachEvent( name, handle );
<span class="lnr"> 3896 </span>       }
<span class="lnr"> 3897 </span>    };
<span class="lnr"> 3898 </span>
<span class="lnr"> 3899 </span>jQuery.Event = <span class="Identifier">function</span>( src, props ) {
<span class="lnr"> 3900 </span><span class="Comment">    // Allow instantiation without the 'new' keyword</span>
<span class="lnr"> 3901 </span><span class="Comment">    // 允许不使用new关键字初始化</span>
<span class="lnr"> 3902 </span>    <span class="Statement">if</span> ( !(<span class="Type">this</span> <span class="Statement">instanceof</span> jQuery.Event) ) {
<span class="lnr"> 3903 </span>       <span class="Statement">return</span> <span class="Statement">new</span> jQuery.Event( src, props );
<span class="lnr"> 3904 </span>    }
<span class="lnr"> 3905 </span>
<span class="lnr"> 3906 </span><span class="Comment">    // Event object</span>
<span class="lnr"> 3907 </span><span class="Comment">    // 事件对象</span>
<span class="lnr"> 3908 </span>    <span class="Statement">if</span> ( src &amp;&amp; src.type ) {
<span class="lnr"> 3909 </span>       <span class="Type">this</span>.originalEvent = src;
<span class="lnr"> 3910 </span>       <span class="Type">this</span>.type = src.type;
<span class="lnr"> 3911 </span>
<span class="lnr"> 3912 </span><span class="Comment">       // Events bubbling up the document may have been marked as prevented</span>
<span class="lnr"> 3913 </span><span class="Comment">       // by a handler lower down the tree; reflect the correct value.</span>
<span class="lnr"> 3914 </span><span class="Comment">       // 冒泡上来的时间可能被底层的树标记为阻止</span>
<span class="lnr"> 3915 </span>       <span class="Type">this</span>.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === <span class="Constant">false</span> ||
<span class="lnr"> 3916 </span>          src.getPreventDefault &amp;&amp; src.getPreventDefault() ) ? returnTrue : returnFalse;
<span class="lnr"> 3917 </span>
<span class="lnr"> 3918 </span><span class="Comment">    // Event type</span>
<span class="lnr"> 3919 </span>    } <span class="Statement">else</span> {
<span class="lnr"> 3920 </span>       <span class="Type">this</span>.type = src;
<span class="lnr"> 3921 </span>    }
<span class="lnr"> 3922 </span>
<span class="lnr"> 3923 </span><span class="Comment">    // Put explicitly provided properties onto the event object</span>
<span class="lnr"> 3924 </span><span class="Comment">    // 为事件对象显式提供属性</span>
<span class="lnr"> 3925 </span>    <span class="Statement">if</span> ( props ) {
<span class="lnr"> 3926 </span>       jQuery.extend( <span class="Type">this</span>, props );
<span class="lnr"> 3927 </span>    }
<span class="lnr"> 3928 </span>
<span class="lnr"> 3929 </span><span class="Comment">    // Create a timestamp if incoming event doesn't have one</span>
<span class="lnr"> 3930 </span><span class="Comment">    // 如果事件对象没有时间戳的话,提供一个</span>
<span class="lnr"> 3931 </span>    <span class="Type">this</span>.timeStamp = src &amp;&amp; src.timeStamp || jQuery.now();
<span class="lnr"> 3932 </span>
<span class="lnr"> 3933 </span><span class="Comment">    // Mark it as fixed</span>
<span class="lnr"> 3934 </span>    <span class="Type">this</span>[ jQuery.expando ] = <span class="Constant">true</span>;
<span class="lnr"> 3935 </span>};
<span class="lnr"> 3936 </span>
<span class="lnr"> 3937 </span><span class="Identifier">function</span> returnFalse() {
<span class="lnr"> 3938 </span>    <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 3939 </span>}
<span class="lnr"> 3940 </span><span class="Identifier">function</span> returnTrue() {
<span class="lnr"> 3941 </span>    <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 3942 </span>}
<span class="lnr"> 3943 </span>
<span class="lnr"> 3944 </span><span class="Comment">// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding</span>
<span class="lnr"> 3945 </span><span class="Comment">// jQuery.Event基于在ECMAScript中规定的DOM3事件</span>
<span class="lnr"> 3946 </span><span class="Comment">// <a href="http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html">http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html</a></span>
<span class="lnr"> 3947 </span>jQuery.Event.prototype = {
<span class="lnr"> 3948 </span>    <span class="Statement">preventDefault</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 3949 </span>       <span class="Type">this</span>.isDefaultPrevented = returnTrue;
<span class="lnr"> 3950 </span>
<span class="lnr"> 3951 </span>       <span class="Type">var</span> e = <span class="Type">this</span>.originalEvent;
<span class="lnr"> 3952 </span>       <span class="Statement">if</span> ( !e ) {
<span class="lnr"> 3953 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3954 </span>       }
<span class="lnr"> 3955 </span>
<span class="lnr"> 3956 </span><span class="Comment">       // if preventDefault exists run it on the original event</span>
<span class="lnr"> 3957 </span><span class="Comment">       // 如果preventDefault存在,在原始事件上调用</span>
<span class="lnr"> 3958 </span>       <span class="Statement">if</span> ( e.preventDefault ) {
<span class="lnr"> 3959 </span>          e.preventDefault();
<span class="lnr"> 3960 </span>
<span class="lnr"> 3961 </span><span class="Comment">       // otherwise set the returnValue property of the original event to false (IE)</span>
<span class="lnr"> 3962 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 3963 </span>          e.returnValue = <span class="Constant">false</span>;
<span class="lnr"> 3964 </span>       }
<span class="lnr"> 3965 </span>    },
<span class="lnr"> 3966 </span>    <span class="Statement">stopPropagation</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 3967 </span>       <span class="Type">this</span>.isPropagationStopped = returnTrue;
<span class="lnr"> 3968 </span>
<span class="lnr"> 3969 </span>       <span class="Type">var</span> e = <span class="Type">this</span>.originalEvent;
<span class="lnr"> 3970 </span>       <span class="Statement">if</span> ( !e ) {
<span class="lnr"> 3971 </span>          <span class="Statement">return</span>;
<span class="lnr"> 3972 </span>       }
<span class="lnr"> 3973 </span><span class="Comment">       // if stopPropagation exists run it on the original event</span>
<span class="lnr"> 3974 </span><span class="Comment">       // 如果阻止冒泡存在,在原始事件上调用</span>
<span class="lnr"> 3975 </span>       <span class="Statement">if</span> ( e.stopPropagation ) {
<span class="lnr"> 3976 </span>          e.stopPropagation();
<span class="lnr"> 3977 </span>       }
<span class="lnr"> 3978 </span><span class="Comment">       // otherwise set the cancelBubble property of the original event to true (IE)</span>
<span class="lnr"> 3979 </span>       e.cancelBubble = <span class="Constant">true</span>;
<span class="lnr"> 3980 </span>    },
<span class="lnr"> 3981 </span>    <span class="Statement">stopImmediatePropagation</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 3982 </span>       <span class="Type">this</span>.isImmediatePropagationStopped = returnTrue;
<span class="lnr"> 3983 </span>       <span class="Type">this</span>.stopPropagation();
<span class="lnr"> 3984 </span>    },
<span class="lnr"> 3985 </span>    <span class="Statement">isDefaultPrevented</span>: returnFalse,
<span class="lnr"> 3986 </span>    <span class="Statement">isPropagationStopped</span>: returnFalse,
<span class="lnr"> 3987 </span>    <span class="Statement">isImmediatePropagationStopped</span>: returnFalse
<span class="lnr"> 3988 </span>};
<span class="lnr"> 3989 </span>
<span class="lnr"> 3990 </span><span class="Comment">// Create mouseenter/leave events using mouseover/out and event-time checks</span>
<span class="lnr"> 3991 </span><span class="Comment">// 使用mouseover/out创建mouseenter/leave,并进行事件检查</span>
<span class="lnr"> 3992 </span>jQuery.each({
<span class="lnr"> 3993 </span>    <span class="Statement">mouseenter</span>: <span class="Constant">&quot;mouseover&quot;</span>,
<span class="lnr"> 3994 </span>    <span class="Statement">mouseleave</span>: <span class="Constant">&quot;mouseout&quot;</span>
<span class="lnr"> 3995 </span>}, <span class="Identifier">function</span>( orig, fix ) {
<span class="lnr"> 3996 </span>    jQuery.event.special[ orig ] = {
<span class="lnr"> 3997 </span>       <span class="Statement">delegateType</span>: fix,
<span class="lnr"> 3998 </span>       <span class="Statement">bindType</span>: fix,
<span class="lnr"> 3999 </span>
<span class="lnr"> 4000 </span>       <span class="Statement">handle</span>: <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4001 </span>          <span class="Type">var</span> ret,
<span class="lnr"> 4002 </span>             target = <span class="Type">this</span>,
<span class="lnr"> 4003 </span>             related = event.relatedTarget,
<span class="lnr"> 4004 </span>             handleObj = event.handleObj,
<span class="lnr"> 4005 </span>             selector = handleObj.selector;
<span class="lnr"> 4006 </span>
<span class="lnr"> 4007 </span><span class="Comment">          // For mousenter/leave call the handler if related is outside the target.</span>
<span class="lnr"> 4008 </span><span class="Comment">          // 处理鼠标进入/移出事件</span>
<span class="lnr"> 4009 </span><span class="Comment">          // NB: No relatedTarget if the mouse left/entered the browser window</span>
<span class="lnr"> 4010 </span>          <span class="Statement">if</span> ( !related || (related !== target &amp;&amp; !jQuery.contains( target, related )) ) {
<span class="lnr"> 4011 </span>             event.type = handleObj.origType;
<span class="lnr"> 4012 </span>             ret = handleObj.handler.apply( <span class="Type">this</span>, arguments );
<span class="lnr"> 4013 </span>             event.type = fix;
<span class="lnr"> 4014 </span>          }
<span class="lnr"> 4015 </span>          <span class="Statement">return</span> ret;
<span class="lnr"> 4016 </span>       }
<span class="lnr"> 4017 </span>    };
<span class="lnr"> 4018 </span>});
<span class="lnr"> 4019 </span>
<span class="lnr"> 4020 </span><span class="Comment">// IE submit delegation</span>
<span class="lnr"> 4021 </span><span class="Comment">// IEsubmit事件代理</span>
<span class="lnr"> 4022 </span><span class="Statement">if</span> ( !jQuery.support.submitBubbles ) {
<span class="lnr"> 4023 </span>
<span class="lnr"> 4024 </span>    jQuery.event.special.submit = {
<span class="lnr"> 4025 </span>       <span class="Statement">setup</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 4026 </span><span class="Comment">          // Only need this for delegated form submit events</span>
<span class="lnr"> 4027 </span><span class="Comment">          // 代理提交的时候才需要这样</span>
<span class="lnr"> 4028 </span>          <span class="Statement">if</span> ( jQuery.nodeName( <span class="Type">this</span>, <span class="Constant">&quot;form&quot;</span> ) ) {
<span class="lnr"> 4029 </span>             <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 4030 </span>          }
<span class="lnr"> 4031 </span>
<span class="lnr"> 4032 </span><span class="Comment">          // Lazy-add a submit handler when a descendant form may potentially be submitted</span>
<span class="lnr"> 4033 </span><span class="Comment">          // 当一个后代表单可能被潜在提交的话,延迟添加一个提交处理器</span>
<span class="lnr"> 4034 </span>          jQuery.event.add( <span class="Type">this</span>, <span class="Constant">&quot;click._submit keypress._submit&quot;</span>, <span class="Identifier">function</span>( e ) {
<span class="lnr"> 4035 </span><span class="Comment">             // Node name check avoids a VML-related crash in IE (#9807)</span>
<span class="lnr"> 4036 </span><span class="Comment">             // 节点名称检查,避免IE中一个VML相关的冲突</span>
<span class="lnr"> 4037 </span>             <span class="Type">var</span> elem = e.target,
<span class="lnr"> 4038 </span>                form = jQuery.nodeName( elem, <span class="Constant">&quot;input&quot;</span> ) || jQuery.nodeName( elem, <span class="Constant">&quot;button&quot;</span> ) ? elem.<span class="Statement">form</span> : <span class="Type">undefined</span>;
<span class="lnr"> 4039 </span>             <span class="Statement">if</span> ( form &amp;&amp; !jQuery._data( form, <span class="Constant">&quot;_submit_attached&quot;</span> ) ) {
<span class="lnr"> 4040 </span>                jQuery.event.add( form, <span class="Constant">&quot;submit._submit&quot;</span>, <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4041 </span>                   event._submit_bubble = <span class="Constant">true</span>;
<span class="lnr"> 4042 </span>                });
<span class="lnr"> 4043 </span>                jQuery._data( form, <span class="Constant">&quot;_submit_attached&quot;</span>, <span class="Constant">true</span> );
<span class="lnr"> 4044 </span>             }
<span class="lnr"> 4045 </span>          });
<span class="lnr"> 4046 </span><span class="Comment">          // return undefined since we don't need an event listener</span>
<span class="lnr"> 4047 </span><span class="Comment">          // 当我们不再需要事件监听器的时候返回undefine</span>
<span class="lnr"> 4048 </span>       },
<span class="lnr"> 4049 </span>
<span class="lnr"> 4050 </span>       <span class="Statement">postDispatch</span>: <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4051 </span><span class="Comment">          // If form was submitted by the user, bubble the event up the tree</span>
<span class="lnr"> 4052 </span><span class="Comment">          // 如果form被用户提交,将事件沿着树向上冒泡</span>
<span class="lnr"> 4053 </span>          <span class="Statement">if</span> ( event._submit_bubble ) {
<span class="lnr"> 4054 </span>             <span class="Statement">delete</span> event._submit_bubble;
<span class="lnr"> 4055 </span>             <span class="Statement">if</span> ( <span class="Type">this</span>.parentNode &amp;&amp; !event.isTrigger ) {
<span class="lnr"> 4056 </span>                jQuery.event.simulate( <span class="Constant">&quot;submit&quot;</span>, <span class="Type">this</span>.parentNode, event, <span class="Constant">true</span> );
<span class="lnr"> 4057 </span>             }
<span class="lnr"> 4058 </span>          }
<span class="lnr"> 4059 </span>       },
<span class="lnr"> 4060 </span>
<span class="lnr"> 4061 </span>       <span class="Statement">teardown</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 4062 </span><span class="Comment">          // Only need this for delegated form submit events</span>
<span class="lnr"> 4063 </span><span class="Comment">          // 代理提交的时候才需要这样</span>
<span class="lnr"> 4064 </span>          <span class="Statement">if</span> ( jQuery.nodeName( <span class="Type">this</span>, <span class="Constant">&quot;form&quot;</span> ) ) {
<span class="lnr"> 4065 </span>             <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 4066 </span>          }
<span class="lnr"> 4067 </span>
<span class="lnr"> 4068 </span><span class="Comment">          // Remove delegated handlers; cleanData eventually reaps submit handlers attached above</span>
<span class="lnr"> 4069 </span><span class="Comment">          // 移除代理处理器</span>
<span class="lnr"> 4070 </span>          jQuery.event.remove( <span class="Type">this</span>, <span class="Constant">&quot;._submit&quot;</span> );
<span class="lnr"> 4071 </span>       }
<span class="lnr"> 4072 </span>    };
<span class="lnr"> 4073 </span>}
<span class="lnr"> 4074 </span>
<span class="lnr"> 4075 </span><span class="Comment">// IE change delegation and checkbox/radio fix</span>
<span class="lnr"> 4076 </span><span class="Comment">// IE改变代理并且修复单选和多选按钮</span>
<span class="lnr"> 4077 </span><span class="Statement">if</span> ( !jQuery.support.changeBubbles ) {
<span class="lnr"> 4078 </span>
<span class="lnr"> 4079 </span>    jQuery.event.special.change = {
<span class="lnr"> 4080 </span>
<span class="lnr"> 4081 </span>       <span class="Statement">setup</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 4082 </span>
<span class="lnr"> 4083 </span>          <span class="Statement">if</span> ( rformElems.test( <span class="Type">this</span>.nodeName ) ) {
<span class="lnr"> 4084 </span><span class="Comment">             // IE doesn't fire change on a check/radio until blur; trigger it on click</span>
<span class="lnr"> 4085 </span><span class="Comment">             // 如果不失去焦点的话,IE不会触发单选和多选按钮的改变；在改变属性的单击事件</span>
<span class="lnr"> 4086 </span><span class="Comment">             // after a propertychange. Eat the blur-change in special.change.handle.</span>
<span class="lnr"> 4087 </span><span class="Comment">             // 中触发事件,取消失去焦点触发的change事件</span>
<span class="lnr"> 4088 </span><span class="Comment">             // This still fires onchange a second time for check/radio after blur.</span>
<span class="lnr"> 4089 </span><span class="Comment">             // 仍然会在失去焦点后第二次触发onchange</span>
<span class="lnr"> 4090 </span>             <span class="Statement">if</span> ( <span class="Type">this</span>.type === <span class="Constant">&quot;checkbox&quot;</span> || <span class="Type">this</span>.type === <span class="Constant">&quot;radio&quot;</span> ) {
<span class="lnr"> 4091 </span>                jQuery.event.add( <span class="Type">this</span>, <span class="Constant">&quot;propertychange._change&quot;</span>, <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4092 </span>                   <span class="Statement">if</span> ( event.originalEvent.propertyName === <span class="Constant">&quot;checked&quot;</span> ) {
<span class="lnr"> 4093 </span>                      <span class="Type">this</span>._just_changed = <span class="Constant">true</span>;
<span class="lnr"> 4094 </span>                   }
<span class="lnr"> 4095 </span>                });
<span class="lnr"> 4096 </span>                jQuery.event.add( <span class="Type">this</span>, <span class="Constant">&quot;click._change&quot;</span>, <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4097 </span>                   <span class="Statement">if</span> ( <span class="Type">this</span>._just_changed &amp;&amp; !event.isTrigger ) {
<span class="lnr"> 4098 </span>                      <span class="Type">this</span>._just_changed = <span class="Constant">false</span>;
<span class="lnr"> 4099 </span>                   }
<span class="lnr"> 4100 </span><span class="Comment">                   // Allow triggered, simulated change events (#11500)</span>
<span class="lnr"> 4101 </span><span class="Comment">                   // 允许触发的、模拟的事件</span>
<span class="lnr"> 4102 </span>                   jQuery.event.simulate( <span class="Constant">&quot;change&quot;</span>, <span class="Type">this</span>, event, <span class="Constant">true</span> );
<span class="lnr"> 4103 </span>                });
<span class="lnr"> 4104 </span>             }
<span class="lnr"> 4105 </span>             <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 4106 </span>          }
<span class="lnr"> 4107 </span><span class="Comment">          // Delegated event; lazy-add a change handler on descendant inputs</span>
<span class="lnr"> 4108 </span><span class="Comment">          // 代理事件,在后代输入框中延迟添加一个改变处理器</span>
<span class="lnr"> 4109 </span>          jQuery.event.add( <span class="Type">this</span>, <span class="Constant">&quot;beforeactivate._change&quot;</span>, <span class="Identifier">function</span>( e ) {
<span class="lnr"> 4110 </span>             <span class="Type">var</span> elem = e.target;
<span class="lnr"> 4111 </span>
<span class="lnr"> 4112 </span>             <span class="Statement">if</span> ( rformElems.test( elem.nodeName ) &amp;&amp; !jQuery._data( elem, <span class="Constant">&quot;_change_attached&quot;</span> ) ) {
<span class="lnr"> 4113 </span>                jQuery.event.add( elem, <span class="Constant">&quot;change._change&quot;</span>, <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4114 </span>                   <span class="Statement">if</span> ( <span class="Type">this</span>.parentNode &amp;&amp; !event.isSimulated &amp;&amp; !event.isTrigger ) {
<span class="lnr"> 4115 </span>                      jQuery.event.simulate( <span class="Constant">&quot;change&quot;</span>, <span class="Type">this</span>.parentNode, event, <span class="Constant">true</span> );
<span class="lnr"> 4116 </span>                   }
<span class="lnr"> 4117 </span>                });
<span class="lnr"> 4118 </span>                jQuery._data( elem, <span class="Constant">&quot;_change_attached&quot;</span>, <span class="Constant">true</span> );
<span class="lnr"> 4119 </span>             }
<span class="lnr"> 4120 </span>          });
<span class="lnr"> 4121 </span>       },
<span class="lnr"> 4122 </span>
<span class="lnr"> 4123 </span>       <span class="Statement">handle</span>: <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4124 </span>          <span class="Type">var</span> elem = event.target;
<span class="lnr"> 4125 </span>
<span class="lnr"> 4126 </span><span class="Comment">          // Swallow native change events from checkbox/radio, we already triggered them above</span>
<span class="lnr"> 4127 </span><span class="Comment">          // 阻止单选和复选框上的默认改变事件,我们已经在上面触发过了</span>
<span class="lnr"> 4128 </span>          <span class="Statement">if</span> ( <span class="Type">this</span> !== elem || event.isSimulated || event.isTrigger || (elem.type !== <span class="Constant">&quot;radio&quot;</span> &amp;&amp; elem.type !== <span class="Constant">&quot;checkbox&quot;</span>) ) {
<span class="lnr"> 4129 </span>             <span class="Statement">return</span> event.handleObj.handler.apply( <span class="Type">this</span>, arguments );
<span class="lnr"> 4130 </span>          }
<span class="lnr"> 4131 </span>       },
<span class="lnr"> 4132 </span>
<span class="lnr"> 4133 </span>       <span class="Statement">teardown</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 4134 </span>          jQuery.event.remove( <span class="Type">this</span>, <span class="Constant">&quot;._change&quot;</span> );
<span class="lnr"> 4135 </span>
<span class="lnr"> 4136 </span>          <span class="Statement">return</span> !rformElems.test( <span class="Type">this</span>.nodeName );
<span class="lnr"> 4137 </span>       }
<span class="lnr"> 4138 </span>    };
<span class="lnr"> 4139 </span>}
<span class="lnr"> 4140 </span>
<span class="lnr"> 4141 </span><span class="Comment">// Create &quot;bubbling&quot; focus and blur events</span>
<span class="lnr"> 4142 </span><span class="Comment">// 创建冒泡获取/失去焦点事件</span>
<span class="lnr"> 4143 </span><span class="Statement">if</span> ( !jQuery.support.focusinBubbles ) {
<span class="lnr"> 4144 </span>    jQuery.each({ <span class="Statement">focus</span>: <span class="Constant">&quot;focusin&quot;</span>, <span class="Statement">blur</span>: <span class="Constant">&quot;focusout&quot;</span> }, <span class="Identifier">function</span>( orig, fix ) {
<span class="lnr"> 4145 </span>
<span class="lnr"> 4146 </span><span class="Comment">       // Attach a single capturing handler while someone wants focusin/focusout</span>
<span class="lnr"> 4147 </span><span class="Comment">       // 附加一个可捕获的处理器</span>
<span class="lnr"> 4148 </span>       <span class="Type">var</span> attaches = <span class="Constant">0</span>,
<span class="lnr"> 4149 </span>          handler = <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4150 </span>             jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), <span class="Constant">true</span> );
<span class="lnr"> 4151 </span>          };
<span class="lnr"> 4152 </span>
<span class="lnr"> 4153 </span>       jQuery.event.special[ fix ] = {
<span class="lnr"> 4154 </span>          <span class="Statement">setup</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 4155 </span>             <span class="Statement">if</span> ( attaches++ === <span class="Constant">0</span> ) {
<span class="lnr"> 4156 </span>                document.addEventListener( orig, handler, <span class="Constant">true</span> );
<span class="lnr"> 4157 </span>             }
<span class="lnr"> 4158 </span>          },
<span class="lnr"> 4159 </span>          <span class="Statement">teardown</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 4160 </span>             <span class="Statement">if</span> ( --attaches === <span class="Constant">0</span> ) {
<span class="lnr"> 4161 </span>                document.removeEventListener( orig, handler, <span class="Constant">true</span> );
<span class="lnr"> 4162 </span>             }
<span class="lnr"> 4163 </span>          }
<span class="lnr"> 4164 </span>       };
<span class="lnr"> 4165 </span>    });
<span class="lnr"> 4166 </span>}
<span class="lnr"> 4167 </span>
<span class="lnr"> 4168 </span>jQuery.fn.extend({
<span class="lnr"> 4169 </span>
<span class="lnr"> 4170 </span>    <span class="Statement">on</span>: <span class="Identifier">function</span>( types, selector, data, fn, <span class="Comment">/*INTERNAL*/</span> one ) {
<span class="lnr"> 4171 </span>       <span class="Type">var</span> origFn, type;
<span class="lnr"> 4172 </span>
<span class="lnr"> 4173 </span><span class="Comment">       // Types can be a map of types/handlers</span>
<span class="lnr"> 4174 </span><span class="Comment">       // types可以是一个types/handlers的表</span>
<span class="lnr"> 4175 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> types === <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 4176 </span><span class="Comment">          // ( types-Object, selector, data )</span>
<span class="lnr"> 4177 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> selector !== <span class="Constant">&quot;string&quot;</span> ) { <span class="Comment">// &amp;&amp; selector != null</span>
<span class="lnr"> 4178 </span><span class="Comment">             // ( types-Object, data )</span>
<span class="lnr"> 4179 </span>             data = data || selector;
<span class="lnr"> 4180 </span>             selector = <span class="Type">undefined</span>;
<span class="lnr"> 4181 </span>          }
<span class="lnr"> 4182 </span>          <span class="Statement">for</span> ( type <span class="Statement">in</span> types ) {
<span class="lnr"> 4183 </span>             <span class="Type">this</span>.on( type, selector, data, types[ type ], one );
<span class="lnr"> 4184 </span>          }
<span class="lnr"> 4185 </span>          <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 4186 </span>       }
<span class="lnr"> 4187 </span>
<span class="lnr"> 4188 </span>       <span class="Statement">if</span> ( data == <span class="Type">null</span> &amp;&amp; fn == <span class="Type">null</span> ) {
<span class="lnr"> 4189 </span><span class="Comment">          // ( types, fn )</span>
<span class="lnr"> 4190 </span>          fn = selector;
<span class="lnr"> 4191 </span>          data = selector = <span class="Type">undefined</span>;
<span class="lnr"> 4192 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( fn == <span class="Type">null</span> ) {
<span class="lnr"> 4193 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> selector === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 4194 </span><span class="Comment">             // ( types, selector, fn )</span>
<span class="lnr"> 4195 </span>             fn = data;
<span class="lnr"> 4196 </span>             data = <span class="Type">undefined</span>;
<span class="lnr"> 4197 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 4198 </span><span class="Comment">             // ( types, data, fn )</span>
<span class="lnr"> 4199 </span>             fn = data;
<span class="lnr"> 4200 </span>             data = selector;
<span class="lnr"> 4201 </span>             selector = <span class="Type">undefined</span>;
<span class="lnr"> 4202 </span>          }
<span class="lnr"> 4203 </span>       }
<span class="lnr"> 4204 </span>       <span class="Statement">if</span> ( fn === <span class="Constant">false</span> ) {
<span class="lnr"> 4205 </span>          fn = returnFalse;
<span class="lnr"> 4206 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( !fn ) {
<span class="lnr"> 4207 </span>          <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 4208 </span>       }
<span class="lnr"> 4209 </span>
<span class="lnr"> 4210 </span>       <span class="Statement">if</span> ( one === <span class="Constant">1</span> ) {
<span class="lnr"> 4211 </span>          origFn = fn;
<span class="lnr"> 4212 </span>          fn = <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4213 </span><span class="Comment">             // Can use an empty set, since event contains the info</span>
<span class="lnr"> 4214 </span><span class="Comment">             // 可以使用一个空集合,event已经包含了信息</span>
<span class="lnr"> 4215 </span>             jQuery().off( event );
<span class="lnr"> 4216 </span>             <span class="Statement">return</span> origFn.apply( <span class="Type">this</span>, arguments );
<span class="lnr"> 4217 </span>          };
<span class="lnr"> 4218 </span><span class="Comment">          // Use same guid so caller can remove using origFn</span>
<span class="lnr"> 4219 </span><span class="Comment">          // 使用同一个guid,这样调用者可以移除origFn</span>
<span class="lnr"> 4220 </span>          fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
<span class="lnr"> 4221 </span>       }
<span class="lnr"> 4222 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each( <span class="Identifier">function</span>() {
<span class="lnr"> 4223 </span>          jQuery.event.add( <span class="Type">this</span>, types, fn, data, selector );
<span class="lnr"> 4224 </span>       });
<span class="lnr"> 4225 </span>    },
<span class="lnr"> 4226 </span>    <span class="Statement">one</span>: <span class="Identifier">function</span>( types, selector, data, fn ) {
<span class="lnr"> 4227 </span>       <span class="Statement">return</span> <span class="Type">this</span>.on( types, selector, data, fn, <span class="Constant">1</span> );
<span class="lnr"> 4228 </span>    },
<span class="lnr"> 4229 </span>    <span class="Statement">off</span>: <span class="Identifier">function</span>( types, selector, fn ) {
<span class="lnr"> 4230 </span>       <span class="Type">var</span> handleObj, type;
<span class="lnr"> 4231 </span>       <span class="Statement">if</span> ( types &amp;&amp; types.preventDefault &amp;&amp; types.handleObj ) {
<span class="lnr"> 4232 </span><span class="Comment">          // ( event )  dispatched jQuery.Event</span>
<span class="lnr"> 4233 </span>          handleObj = types.handleObj;
<span class="lnr"> 4234 </span>          jQuery( types.delegateTarget ).off(
<span class="lnr"> 4235 </span>             handleObj.namespace ? handleObj.origType + <span class="Constant">&quot;.&quot;</span> + handleObj.<span class="Statement">namespace</span> : handleObj.origType,
<span class="lnr"> 4236 </span>             handleObj.selector,
<span class="lnr"> 4237 </span>             handleObj.handler
<span class="lnr"> 4238 </span>          );
<span class="lnr"> 4239 </span>          <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 4240 </span>       }
<span class="lnr"> 4241 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> types === <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 4242 </span><span class="Comment">          // ( types-object [, selector] )</span>
<span class="lnr"> 4243 </span>          <span class="Statement">for</span> ( type <span class="Statement">in</span> types ) {
<span class="lnr"> 4244 </span>             <span class="Type">this</span>.off( type, selector, types[ type ] );
<span class="lnr"> 4245 </span>          }
<span class="lnr"> 4246 </span>          <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 4247 </span>       }
<span class="lnr"> 4248 </span>       <span class="Statement">if</span> ( selector === <span class="Constant">false</span> || <span class="Statement">typeof</span> selector === <span class="Constant">&quot;function&quot;</span> ) {
<span class="lnr"> 4249 </span><span class="Comment">          // ( types [, fn] )</span>
<span class="lnr"> 4250 </span>          fn = selector;
<span class="lnr"> 4251 </span>          selector = <span class="Type">undefined</span>;
<span class="lnr"> 4252 </span>       }
<span class="lnr"> 4253 </span>       <span class="Statement">if</span> ( fn === <span class="Constant">false</span> ) {
<span class="lnr"> 4254 </span>          fn = returnFalse;
<span class="lnr"> 4255 </span>       }
<span class="lnr"> 4256 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 4257 </span>          jQuery.event.remove( <span class="Type">this</span>, types, fn, selector );
<span class="lnr"> 4258 </span>       });
<span class="lnr"> 4259 </span>    },
<span class="lnr"> 4260 </span>
<span class="lnr"> 4261 </span>    <span class="Statement">bind</span>: <span class="Identifier">function</span>( types, data, fn ) {
<span class="lnr"> 4262 </span>       <span class="Statement">return</span> <span class="Type">this</span>.on( types, <span class="Type">null</span>, data, fn );
<span class="lnr"> 4263 </span>    },
<span class="lnr"> 4264 </span>    <span class="Statement">unbind</span>: <span class="Identifier">function</span>( types, fn ) {
<span class="lnr"> 4265 </span>       <span class="Statement">return</span> <span class="Type">this</span>.off( types, <span class="Type">null</span>, fn );
<span class="lnr"> 4266 </span>    },
<span class="lnr"> 4267 </span>
<span class="lnr"> 4268 </span>    <span class="Statement">live</span>: <span class="Identifier">function</span>( types, data, fn ) {
<span class="lnr"> 4269 </span>       jQuery( <span class="Type">this</span>.context ).on( types, <span class="Type">this</span>.selector, data, fn );
<span class="lnr"> 4270 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 4271 </span>    },
<span class="lnr"> 4272 </span>    <span class="Statement">die</span>: <span class="Identifier">function</span>( types, fn ) {
<span class="lnr"> 4273 </span>       jQuery( <span class="Type">this</span>.context ).off( types, <span class="Type">this</span>.selector || <span class="Constant">&quot;**&quot;</span>, fn );
<span class="lnr"> 4274 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 4275 </span>    },
<span class="lnr"> 4276 </span>
<span class="lnr"> 4277 </span>    <span class="Statement">delegate</span>: <span class="Identifier">function</span>( selector, types, data, fn ) {
<span class="lnr"> 4278 </span>       <span class="Statement">return</span> <span class="Type">this</span>.on( types, selector, data, fn );
<span class="lnr"> 4279 </span>    },
<span class="lnr"> 4280 </span>    <span class="Statement">undelegate</span>: <span class="Identifier">function</span>( selector, types, fn ) {
<span class="lnr"> 4281 </span><span class="Comment">       // ( namespace ) or ( selector, types [, fn] )</span>
<span class="lnr"> 4282 </span>       <span class="Statement">return</span> arguments.length == <span class="Constant">1</span>? <span class="Type">this</span>.off( selector, <span class="Constant">&quot;**&quot;</span> ) : <span class="Type">this</span>.off( types, selector || <span class="Constant">&quot;**&quot;</span>, fn );
<span class="lnr"> 4283 </span>    },
<span class="lnr"> 4284 </span>
<span class="lnr"> 4285 </span>    <span class="Statement">trigger</span>: <span class="Identifier">function</span>( type, data ) {
<span class="lnr"> 4286 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 4287 </span>          jQuery.event.trigger( type, data, <span class="Type">this</span> );
<span class="lnr"> 4288 </span>       });
<span class="lnr"> 4289 </span>    },
<span class="lnr"> 4290 </span>    <span class="Statement">triggerHandler</span>: <span class="Identifier">function</span>( type, data ) {
<span class="lnr"> 4291 </span>       <span class="Statement">if</span> ( <span class="Type">this</span>[<span class="Constant">0</span>] ) {
<span class="lnr"> 4292 </span>          <span class="Statement">return</span> jQuery.event.trigger( type, data, <span class="Type">this</span>[<span class="Constant">0</span>], <span class="Constant">true</span> );
<span class="lnr"> 4293 </span>       }
<span class="lnr"> 4294 </span>    },
<span class="lnr"> 4295 </span>
<span class="lnr"> 4296 </span>    <span class="Statement">toggle</span>: <span class="Identifier">function</span>( fn ) {
<span class="lnr"> 4297 </span><span class="Comment">       // Save reference to arguments for access in closure</span>
<span class="lnr"> 4298 </span><span class="Comment">       // 为在闭包中访问保留引用到参数中</span>
<span class="lnr"> 4299 </span>       <span class="Type">var</span> args = arguments,
<span class="lnr"> 4300 </span>          guid = fn.guid || jQuery.guid++,
<span class="lnr"> 4301 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 4302 </span>          toggler = <span class="Identifier">function</span>( event ) {
<span class="lnr"> 4303 </span><span class="Comment">             // Figure out which function to execute</span>
<span class="lnr"> 4304 </span><span class="Comment">             // 确定要执行的函数</span>
<span class="lnr"> 4305 </span>             <span class="Type">var</span> lastToggle = ( jQuery._data( <span class="Type">this</span>, <span class="Constant">&quot;lastToggle&quot;</span> + fn.guid ) || <span class="Constant">0</span> ) % i;
<span class="lnr"> 4306 </span>             jQuery._data( <span class="Type">this</span>, <span class="Constant">&quot;lastToggle&quot;</span> + fn.guid, lastToggle + <span class="Constant">1</span> );
<span class="lnr"> 4307 </span>
<span class="lnr"> 4308 </span><span class="Comment">             // Make sure that clicks stop</span>
<span class="lnr"> 4309 </span><span class="Comment">             // 保证单击事件被停止</span>
<span class="lnr"> 4310 </span>             event.preventDefault();
<span class="lnr"> 4311 </span>
<span class="lnr"> 4312 </span><span class="Comment">             // and execute the function</span>
<span class="lnr"> 4313 </span><span class="Comment">             // 执行函数</span>
<span class="lnr"> 4314 </span>             <span class="Statement">return</span> args[ lastToggle ].apply( <span class="Type">this</span>, arguments ) || <span class="Constant">false</span>;
<span class="lnr"> 4315 </span>          };
<span class="lnr"> 4316 </span>
<span class="lnr"> 4317 </span><span class="Comment">       // link all the functions, so any of them can unbind this click handler</span>
<span class="lnr"> 4318 </span><span class="Comment">       // 连接所有的函数,所以这些函数可以在单击事件处理器中被移除</span>
<span class="lnr"> 4319 </span>       toggler.guid = guid;
<span class="lnr"> 4320 </span>       <span class="Statement">while</span> ( i &lt; args.length ) {
<span class="lnr"> 4321 </span>          args[ i++ ].guid = guid;
<span class="lnr"> 4322 </span>       }
<span class="lnr"> 4323 </span>
<span class="lnr"> 4324 </span>       <span class="Statement">return</span> <span class="Type">this</span>.click( toggler );
<span class="lnr"> 4325 </span>    },
<span class="lnr"> 4326 </span>
<span class="lnr"> 4327 </span>    <span class="Statement">hover</span>: <span class="Identifier">function</span>( fnOver, fnOut ) {
<span class="lnr"> 4328 </span>       <span class="Statement">return</span> <span class="Type">this</span>.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
<span class="lnr"> 4329 </span>    }
<span class="lnr"> 4330 </span>});
<span class="lnr"> 4331 </span>
<span class="lnr"> 4332 </span>jQuery.each( (<span class="Constant">&quot;blur focus focusin focusout load resize scroll unload click dblclick &quot;</span> +
<span class="lnr"> 4333 </span>    <span class="Constant">&quot;mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave &quot;</span> +
<span class="lnr"> 4334 </span>    <span class="Constant">&quot;change select submit keydown keypress keyup error contextmenu&quot;</span>).split(<span class="Constant">&quot; &quot;</span>), <span class="Identifier">function</span>( i, name ) {
<span class="lnr"> 4335 </span>
<span class="lnr"> 4336 </span><span class="Comment">    // Handle event binding</span>
<span class="lnr"> 4337 </span><span class="Comment">    // 处理事件绑定</span>
<span class="lnr"> 4338 </span>    jQuery.fn[ name ] = <span class="Identifier">function</span>( data, fn ) {
<span class="lnr"> 4339 </span>       <span class="Statement">if</span> ( fn == <span class="Type">null</span> ) {
<span class="lnr"> 4340 </span>          fn = data;
<span class="lnr"> 4341 </span>          data = <span class="Type">null</span>;
<span class="lnr"> 4342 </span>       }
<span class="lnr"> 4343 </span>
<span class="lnr"> 4344 </span>       <span class="Statement">return</span> arguments.length &gt; <span class="Constant">0</span> ?
<span class="lnr"> 4345 </span>          <span class="Type">this</span>.on( name, <span class="Type">null</span>, data, fn ) :
<span class="lnr"> 4346 </span>          <span class="Type">this</span>.trigger( name );
<span class="lnr"> 4347 </span>    };
<span class="lnr"> 4348 </span>
<span class="lnr"> 4349 </span>    <span class="Statement">if</span> ( rkeyEvent.test( name ) ) {
<span class="lnr"> 4350 </span>       jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
<span class="lnr"> 4351 </span>    }
<span class="lnr"> 4352 </span>
<span class="lnr"> 4353 </span>    <span class="Statement">if</span> ( rmouseEvent.test( name ) ) {
<span class="lnr"> 4354 </span>       jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
<span class="lnr"> 4355 </span>    }
<span class="lnr"> 4356 </span>});
<span class="lnr"> 4357 </span><span class="Comment">/*!</span>
<span class="lnr"> 4358 </span><span class="Comment"> * Sizzle CSS Selector Engine</span>
<span class="lnr"> 4359 </span><span class="Comment"> * css选择器</span>
<span class="lnr"> 4360 </span><span class="Comment"> *  Copyright 2012 jQuery Foundation and other contributors</span>
<span class="lnr"> 4361 </span><span class="Comment"> *  Released under the MIT license</span>
<span class="lnr"> 4362 </span><span class="Comment"> *  <a href="http://sizzlejs.com/">http://sizzlejs.com/</a></span>
<span class="lnr"> 4363 </span><span class="Comment"> */</span>
<span class="lnr"> 4364 </span>(<span class="Identifier">function</span>( window, undefined ) {
<span class="lnr"> 4365 </span>
<span class="lnr"> 4366 </span><span class="Type">var</span> dirruns,
<span class="lnr"> 4367 </span>    cachedruns,
<span class="lnr"> 4368 </span>    assertGetIdNotName,
<span class="lnr"> 4369 </span>    Expr,
<span class="lnr"> 4370 </span>    getText,
<span class="lnr"> 4371 </span>    isXML,
<span class="lnr"> 4372 </span>    contains,
<span class="lnr"> 4373 </span>    compile,
<span class="lnr"> 4374 </span>    sortOrder,
<span class="lnr"> 4375 </span>    hasDuplicate,
<span class="lnr"> 4376 </span>
<span class="lnr"> 4377 </span>    baseHasDuplicate = <span class="Constant">true</span>,
<span class="lnr"> 4378 </span>    strundefined = <span class="Constant">&quot;undefined&quot;</span>,
<span class="lnr"> 4379 </span>
<span class="lnr"> 4380 </span>    expando = ( <span class="Constant">&quot;sizcache&quot;</span> + <span class="Special">Math</span>.random() ).replace( <span class="Constant">&quot;.&quot;</span>, <span class="Constant">&quot;&quot;</span> ),
<span class="lnr"> 4381 </span>
<span class="lnr"> 4382 </span>    document = window.document,
<span class="lnr"> 4383 </span>    docElem = document.documentElement,
<span class="lnr"> 4384 </span>    done = <span class="Constant">0</span>,
<span class="lnr"> 4385 </span>    slice = [].slice,
<span class="lnr"> 4386 </span>    push = [].push,
<span class="lnr"> 4387 </span>
<span class="lnr"> 4388 </span><span class="Comment">    // Augment a function for special use by Sizzle</span>
<span class="lnr"> 4389 </span>    markFunction = <span class="Identifier">function</span>( fn, value ) {
<span class="lnr"> 4390 </span>       fn[ expando ] = value || <span class="Constant">true</span>;
<span class="lnr"> 4391 </span>       <span class="Statement">return</span> fn;
<span class="lnr"> 4392 </span>    },
<span class="lnr"> 4393 </span>
<span class="lnr"> 4394 </span>    createCache = <span class="Identifier">function</span>() {
<span class="lnr"> 4395 </span>       <span class="Type">var</span> cache = {},
<span class="lnr"> 4396 </span>          keys = [];
<span class="lnr"> 4397 </span>
<span class="lnr"> 4398 </span>       <span class="Statement">return</span> markFunction(<span class="Identifier">function</span>( key, value ) {
<span class="lnr"> 4399 </span><span class="Comment">          // Only keep the most recent entries</span>
<span class="lnr"> 4400 </span>          <span class="Statement">if</span> ( keys.push( key ) &gt; Expr.cacheLength ) {
<span class="lnr"> 4401 </span>             <span class="Statement">delete</span> cache[ keys.shift() ];
<span class="lnr"> 4402 </span>          }
<span class="lnr"> 4403 </span>
<span class="lnr"> 4404 </span>          <span class="Statement">return</span> (cache[ key ] = value);
<span class="lnr"> 4405 </span>       }, cache );
<span class="lnr"> 4406 </span>    },
<span class="lnr"> 4407 </span>
<span class="lnr"> 4408 </span>    classCache = createCache(),
<span class="lnr"> 4409 </span>    tokenCache = createCache(),
<span class="lnr"> 4410 </span>    compilerCache = createCache(),
<span class="lnr"> 4411 </span>
<span class="lnr"> 4412 </span><span class="Comment">    // Regex</span>
<span class="lnr"> 4413 </span>
<span class="lnr"> 4414 </span><span class="Comment">    // Whitespace characters <a href="http://www.w3.org/TR/css3-selectors/#whitespace">http://www.w3.org/TR/css3-selectors/#whitespace</a></span>
<span class="lnr"> 4415 </span><span class="Comment">    // 空白字符</span>
<span class="lnr"> 4416 </span>    whitespace = <span class="Constant">&quot;[</span><span class="Special">\\</span><span class="Constant">x20</span><span class="Special">\\</span><span class="Constant">t</span><span class="Special">\\</span><span class="Constant">r</span><span class="Special">\\</span><span class="Constant">n</span><span class="Special">\\</span><span class="Constant">f]&quot;</span>,
<span class="lnr"> 4417 </span><span class="Comment">    // <a href="http://www.w3.org/TR/css3-syntax/#characters">http://www.w3.org/TR/css3-syntax/#characters</a></span>
<span class="lnr"> 4418 </span><span class="Comment">    // 编码</span>
<span class="lnr"> 4419 </span>    characterEncoding = <span class="Constant">&quot;(?:</span><span class="Special">\\\\</span><span class="Constant">.|[-</span><span class="Special">\\</span><span class="Constant">w]|[^</span><span class="Special">\\</span><span class="Constant">x00-</span><span class="Special">\\</span><span class="Constant">xa0])+&quot;</span>,
<span class="lnr"> 4420 </span>
<span class="lnr"> 4421 </span><span class="Comment">    // Loosely modeled on CSS identifier characters</span>
<span class="lnr"> 4422 </span><span class="Comment">    // An unquoted value should be a CSS identifier (<a href="http://www.w3.org/TR/css3-selectors/#attribute-selectors)">http://www.w3.org/TR/css3-selectors/#attribute-selectors)</a></span>
<span class="lnr"> 4423 </span><span class="Comment">    // Proper syntax: <a href="http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier">http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier</a></span>
<span class="lnr"> 4424 </span>    identifier = characterEncoding.replace( <span class="Constant">&quot;w&quot;</span>, <span class="Constant">&quot;w#&quot;</span> ),
<span class="lnr"> 4425 </span>
<span class="lnr"> 4426 </span><span class="Comment">    // Acceptable operators <a href="http://www.w3.org/TR/selectors/#attribute-selectors">http://www.w3.org/TR/selectors/#attribute-selectors</a></span>
<span class="lnr"> 4427 </span><span class="Comment">    // 操作符</span>
<span class="lnr"> 4428 </span>    operators = <span class="Constant">&quot;([*^$|!~]?=)&quot;</span>,
<span class="lnr"> 4429 </span>    attributes = <span class="Constant">&quot;</span><span class="Special">\\</span><span class="Constant">[&quot;</span> + whitespace + <span class="Constant">&quot;*(&quot;</span> + characterEncoding + <span class="Constant">&quot;)&quot;</span> + whitespace +
<span class="lnr"> 4430 </span>       <span class="Constant">&quot;*(?:&quot;</span> + operators + whitespace + <span class="Constant">&quot;*(?:(['</span><span class="Special">\&quot;</span><span class="Constant">])((?:</span><span class="Special">\\\\</span><span class="Constant">.|[^</span><span class="Special">\\\\</span><span class="Constant">])*?)</span><span class="Special">\\</span><span class="Constant">3|(&quot;</span> + identifier + <span class="Constant">&quot;)|)|)&quot;</span> + whitespace + <span class="Constant">&quot;*</span><span class="Special">\\</span><span class="Constant">]&quot;</span>,
<span class="lnr"> 4431 </span>
<span class="lnr"> 4432 </span><span class="Comment">    // Prefer arguments not in parens/brackets,</span>
<span class="lnr"> 4433 </span><span class="Comment">    //   then attribute selectors and non-pseudos (denoted by :),</span>
<span class="lnr"> 4434 </span><span class="Comment">    //   then anything else</span>
<span class="lnr"> 4435 </span><span class="Comment">    // These preferences are here to reduce the number of selectors</span>
<span class="lnr"> 4436 </span><span class="Comment">    //   needing tokenize in the PSEUDO preFilter</span>
<span class="lnr"> 4437 </span>    pseudos = <span class="Constant">&quot;:(&quot;</span> + characterEncoding + <span class="Constant">&quot;)(?:</span><span class="Special">\\</span><span class="Constant">((?:(['</span><span class="Special">\&quot;</span><span class="Constant">])((?:</span><span class="Special">\\\\</span><span class="Constant">.|[^</span><span class="Special">\\\\</span><span class="Constant">])*?)</span><span class="Special">\\</span><span class="Constant">2|([^()[</span><span class="Special">\\</span><span class="Constant">]]*|(?:(?:&quot;</span> + attributes + <span class="Constant">&quot;)|[^:]|</span><span class="Special">\\\\</span><span class="Constant">.)*|.*))</span><span class="Special">\\</span><span class="Constant">)|)&quot;</span>,
<span class="lnr"> 4438 </span>
<span class="lnr"> 4439 </span><span class="Comment">    // For matchExpr.POS and matchExpr.needsContext</span>
<span class="lnr"> 4440 </span><span class="Comment">    // 匹配位置关键字</span>
<span class="lnr"> 4441 </span>    pos = <span class="Constant">&quot;:(nth|eq|gt|lt|first|last|even|odd)(?:</span><span class="Special">\\</span><span class="Constant">(((?:-</span><span class="Special">\\</span><span class="Constant">d)?</span><span class="Special">\\</span><span class="Constant">d*)</span><span class="Special">\\</span><span class="Constant">)|)(?=[^-]|$)&quot;</span>,
<span class="lnr"> 4442 </span>
<span class="lnr"> 4443 </span><span class="Comment">    // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter</span>
<span class="lnr"> 4444 </span><span class="Comment">    // 清理空白</span>
<span class="lnr"> 4445 </span>    rtrim = <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^&quot;</span> + whitespace + <span class="Constant">&quot;+|((?:^|[^</span><span class="Special">\\\\</span><span class="Constant">])(?:</span><span class="Special">\\\\</span><span class="Constant">.)*)&quot;</span> + whitespace + <span class="Constant">&quot;+$&quot;</span>, <span class="Constant">&quot;g&quot;</span> ),
<span class="lnr"> 4446 </span>
<span class="lnr"> 4447 </span>    rcomma = <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^&quot;</span> + whitespace + <span class="Constant">&quot;*,&quot;</span> + whitespace + <span class="Constant">&quot;*&quot;</span> ),
<span class="lnr"> 4448 </span>    rcombinators = <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^&quot;</span> + whitespace + <span class="Constant">&quot;*([</span><span class="Special">\\</span><span class="Constant">x20</span><span class="Special">\\</span><span class="Constant">t</span><span class="Special">\\</span><span class="Constant">r</span><span class="Special">\\</span><span class="Constant">n</span><span class="Special">\\</span><span class="Constant">f&gt;+~])&quot;</span> + whitespace + <span class="Constant">&quot;*&quot;</span> ),
<span class="lnr"> 4449 </span>    rpseudo = <span class="Statement">new</span> <span class="Special">RegExp</span>( pseudos ),
<span class="lnr"> 4450 </span>
<span class="lnr"> 4451 </span><span class="Comment">    // Easily-parseable/retrievable ID or TAG or CLASS selectors</span>
<span class="lnr"> 4452 </span><span class="Comment">    // 处理ID,TAG,CLASS选择器</span>
<span class="lnr"> 4453 </span>    rquickExpr = <span class="Constant">/^(?:#([</span><span class="Special">\w\-</span><span class="Constant">]+)|(</span><span class="Special">\w</span><span class="Constant">+)|</span><span class="Special">\.</span><span class="Constant">([</span><span class="Special">\w\-</span><span class="Constant">]+))$/</span>,
<span class="lnr"> 4454 </span>
<span class="lnr"> 4455 </span><span class="Comment">    // 非</span>
<span class="lnr"> 4456 </span>    rnot = <span class="Constant">/^:not/</span>,
<span class="lnr"> 4457 </span>    rsibling = <span class="Constant">/[</span><span class="Special">\x20\t\r\n\f</span><span class="Constant">]*[+~]/</span>,
<span class="lnr"> 4458 </span><span class="Comment">    // 不以...结尾</span>
<span class="lnr"> 4459 </span>    rendsWithNot = <span class="Constant">/:not</span><span class="Special">\(</span><span class="Constant">$/</span>,
<span class="lnr"> 4460 </span>
<span class="lnr"> 4461 </span><span class="Comment">    // h1,h2,...,h6标签</span>
<span class="lnr"> 4462 </span>    rheader = <span class="Constant">/h</span><span class="Special">\d</span><span class="Constant">/i</span>,
<span class="lnr"> 4463 </span><span class="Comment">    // 输入</span>
<span class="lnr"> 4464 </span>    rinputs = <span class="Constant">/input|select|textarea|button/i</span>,
<span class="lnr"> 4465 </span>
<span class="lnr"> 4466 </span>    rbackslash = <span class="Constant">/</span><span class="Special">\\</span><span class="Constant">(?!</span><span class="Special">\\</span><span class="Constant">)/g</span>,
<span class="lnr"> 4467 </span>
<span class="lnr"> 4468 </span><span class="Comment">    // 匹配</span>
<span class="lnr"> 4469 </span>    matchExpr = {
<span class="lnr"> 4470 </span>       <span class="Constant">&quot;ID&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^#(&quot;</span> + characterEncoding + <span class="Constant">&quot;)&quot;</span> ),
<span class="lnr"> 4471 </span>       <span class="Constant">&quot;CLASS&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^</span><span class="Special">\\</span><span class="Constant">.(&quot;</span> + characterEncoding + <span class="Constant">&quot;)&quot;</span> ),
<span class="lnr"> 4472 </span>       <span class="Constant">&quot;NAME&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^</span><span class="Special">\\</span><span class="Constant">[name=['</span><span class="Special">\&quot;</span><span class="Constant">]?(&quot;</span> + characterEncoding + <span class="Constant">&quot;)['</span><span class="Special">\&quot;</span><span class="Constant">]?</span><span class="Special">\\</span><span class="Constant">]&quot;</span> ),
<span class="lnr"> 4473 </span>       <span class="Constant">&quot;TAG&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^(&quot;</span> + characterEncoding.replace( <span class="Constant">&quot;w&quot;</span>, <span class="Constant">&quot;w*&quot;</span> ) + <span class="Constant">&quot;)&quot;</span> ),
<span class="lnr"> 4474 </span>       <span class="Constant">&quot;ATTR&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^&quot;</span> + attributes ),
<span class="lnr"> 4475 </span>       <span class="Constant">&quot;PSEUDO&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^&quot;</span> + pseudos ),
<span class="lnr"> 4476 </span>       <span class="Constant">&quot;CHILD&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^:(only|nth|last|first)-child(?:</span><span class="Special">\\</span><span class="Constant">(&quot;</span> + whitespace +
<span class="lnr"> 4477 </span>          <span class="Constant">&quot;*(even|odd|(([+-]|)(</span><span class="Special">\\</span><span class="Constant">d*)n|)&quot;</span> + whitespace + <span class="Constant">&quot;*(?:([+-]|)&quot;</span> + whitespace +
<span class="lnr"> 4478 </span>          <span class="Constant">&quot;*(</span><span class="Special">\\</span><span class="Constant">d+)|))&quot;</span> + whitespace + <span class="Constant">&quot;*</span><span class="Special">\\</span><span class="Constant">)|)&quot;</span>, <span class="Constant">&quot;i&quot;</span> ),
<span class="lnr"> 4479 </span>       <span class="Constant">&quot;POS&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( pos, <span class="Constant">&quot;ig&quot;</span> ),
<span class="lnr"> 4480 </span><span class="Comment">       // For use in libraries implementing .is()</span>
<span class="lnr"> 4481 </span>       <span class="Constant">&quot;needsContext&quot;</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^&quot;</span> + whitespace + <span class="Constant">&quot;*[&gt;+~]|&quot;</span> + pos, <span class="Constant">&quot;i&quot;</span> )
<span class="lnr"> 4482 </span>    },
<span class="lnr"> 4483 </span>
<span class="lnr"> 4484 </span><span class="Comment">    // Support</span>
<span class="lnr"> 4485 </span>
<span class="lnr"> 4486 </span><span class="Comment">    // Used for testing something on an element</span>
<span class="lnr"> 4487 </span><span class="Comment">    // 在元素上进行一些测试</span>
<span class="lnr"> 4488 </span>    assert = <span class="Identifier">function</span>( fn ) {
<span class="lnr"> 4489 </span>       <span class="Type">var</span> div = document.createElement(<span class="Constant">&quot;div&quot;</span>);
<span class="lnr"> 4490 </span>
<span class="lnr"> 4491 </span>       <span class="Statement">try</span> {
<span class="lnr"> 4492 </span>          <span class="Statement">return</span> fn( div );
<span class="lnr"> 4493 </span>       } <span class="Statement">catch</span> (e) {
<span class="lnr"> 4494 </span>          <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 4495 </span>       } <span class="Statement">finally</span> {
<span class="lnr"> 4496 </span><span class="Comment">          // release memory in IE</span>
<span class="lnr"> 4497 </span><span class="Comment">          // 在IE中释放内存</span>
<span class="lnr"> 4498 </span>          div = <span class="Type">null</span>;
<span class="lnr"> 4499 </span>       }
<span class="lnr"> 4500 </span>    },
<span class="lnr"> 4501 </span>
<span class="lnr"> 4502 </span><span class="Comment">    // Check if getElementsByTagName(&quot;*&quot;) returns only elements</span>
<span class="lnr"> 4503 </span><span class="Comment">    // 检查getElementsByTagName(&quot;*&quot;)是否只返回元素</span>
<span class="lnr"> 4504 </span>    assertTagNameNoComments = assert(<span class="Identifier">function</span>( div ) {
<span class="lnr"> 4505 </span>       div.appendChild( document.createComment(<span class="Constant">&quot;&quot;</span>) );
<span class="lnr"> 4506 </span>       <span class="Statement">return</span> !div.getElementsByTagName(<span class="Constant">&quot;*&quot;</span>).length;
<span class="lnr"> 4507 </span>    }),
<span class="lnr"> 4508 </span>
<span class="lnr"> 4509 </span><span class="Comment">    // Check if getAttribute returns normalized href attributes</span>
<span class="lnr"> 4510 </span><span class="Comment">    // 检查getAttribute是否返回规范的href属性</span>
<span class="lnr"> 4511 </span>    assertHrefNotNormalized = assert(<span class="Identifier">function</span>( div ) {
<span class="lnr"> 4512 </span>       div.innerHTML = <span class="Constant">&quot;&lt;a href='#'&gt;&lt;/a&gt;&quot;</span>;
<span class="lnr"> 4513 </span>       <span class="Statement">return</span> div.firstChild &amp;&amp; <span class="Statement">typeof</span> div.firstChild.getAttribute !== strundefined &amp;&amp;
<span class="lnr"> 4514 </span>          div.firstChild.getAttribute(<span class="Constant">&quot;href&quot;</span>) === <span class="Constant">&quot;#&quot;</span>;
<span class="lnr"> 4515 </span>    }),
<span class="lnr"> 4516 </span>
<span class="lnr"> 4517 </span><span class="Comment">    // Check if attributes should be retrieved by attribute nodes</span>
<span class="lnr"> 4518 </span>    assertAttributes = assert(<span class="Identifier">function</span>( div ) {
<span class="lnr"> 4519 </span>       div.innerHTML = <span class="Constant">&quot;&lt;select&gt;&lt;/select&gt;&quot;</span>;
<span class="lnr"> 4520 </span>       <span class="Type">var</span> type = <span class="Statement">typeof</span> div.lastChild.getAttribute(<span class="Constant">&quot;multiple&quot;</span>);
<span class="lnr"> 4521 </span><span class="Comment">       // IE8 returns a string for some attributes even when not present</span>
<span class="lnr"> 4522 </span><span class="Comment">       // IE8会为某些字符串返回一个字符串,即使这些属性并不存在</span>
<span class="lnr"> 4523 </span>       <span class="Statement">return</span> type !== <span class="Constant">&quot;boolean&quot;</span> &amp;&amp; type !== <span class="Constant">&quot;string&quot;</span>;
<span class="lnr"> 4524 </span>    }),
<span class="lnr"> 4525 </span>
<span class="lnr"> 4526 </span><span class="Comment">    // Check if getElementsByClassName can be trusted</span>
<span class="lnr"> 4527 </span><span class="Comment">    // 检查getElementsByClassName是否可靠</span>
<span class="lnr"> 4528 </span>    assertUsableClassName = assert(<span class="Identifier">function</span>( div ) {
<span class="lnr"> 4529 </span><span class="Comment">       // Opera can't find a second classname (in 9.6)</span>
<span class="lnr"> 4530 </span>       div.innerHTML = <span class="Constant">&quot;&lt;div class='hidden e'&gt;&lt;/div&gt;&lt;div class='hidden'&gt;&lt;/div&gt;&quot;</span>;
<span class="lnr"> 4531 </span>       <span class="Statement">if</span> ( !div.getElementsByClassName || !div.getElementsByClassName(<span class="Constant">&quot;e&quot;</span>).length ) {
<span class="lnr"> 4532 </span>          <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 4533 </span>       }
<span class="lnr"> 4534 </span>
<span class="lnr"> 4535 </span><span class="Comment">       // Safari 3.2 caches class attributes and doesn't catch changes</span>
<span class="lnr"> 4536 </span><span class="Comment">       // Safari 3.2缓存class属性并且不会捕捉更改</span>
<span class="lnr"> 4537 </span>       div.lastChild.className = <span class="Constant">&quot;e&quot;</span>;
<span class="lnr"> 4538 </span>       <span class="Statement">return</span> div.getElementsByClassName(<span class="Constant">&quot;e&quot;</span>).length === <span class="Constant">2</span>;
<span class="lnr"> 4539 </span>    }),
<span class="lnr"> 4540 </span>
<span class="lnr"> 4541 </span><span class="Comment">    // Check if getElementById returns elements by name</span>
<span class="lnr"> 4542 </span><span class="Comment">    // 检查getElementById是否根据name返回一个元素</span>
<span class="lnr"> 4543 </span><span class="Comment">    // Check if getElementsByName privileges form controls or returns elements by ID</span>
<span class="lnr"> 4544 </span>    assertUsableName = assert(<span class="Identifier">function</span>( div ) {
<span class="lnr"> 4545 </span><span class="Comment">       // Inject content</span>
<span class="lnr"> 4546 </span><span class="Comment">       // 注入内容</span>
<span class="lnr"> 4547 </span>       div.id = expando + <span class="Constant">0</span>;
<span class="lnr"> 4548 </span>       div.innerHTML = <span class="Constant">&quot;&lt;a name='&quot;</span> + expando + <span class="Constant">&quot;'&gt;&lt;/a&gt;&lt;div name='&quot;</span> + expando + <span class="Constant">&quot;'&gt;&lt;/div&gt;&quot;</span>;
<span class="lnr"> 4549 </span>       docElem.insertBefore( div, docElem.firstChild );
<span class="lnr"> 4550 </span>
<span class="lnr"> 4551 </span><span class="Comment">       // Test</span>
<span class="lnr"> 4552 </span><span class="Comment">       // 测试</span>
<span class="lnr"> 4553 </span>       <span class="Type">var</span> pass = document.getElementsByName &amp;&amp;
<span class="lnr"> 4554 </span><span class="Comment">          // buggy browsers will return fewer than the correct 2</span>
<span class="lnr"> 4555 </span><span class="Comment">          // 有bug的浏览器会返回比2小的数字</span>
<span class="lnr"> 4556 </span>          document.getElementsByName( expando ).length === <span class="Constant">2</span> +
<span class="lnr"> 4557 </span><span class="Comment">          // buggy browsers will return more than the correct 0</span>
<span class="lnr"> 4558 </span><span class="Comment">          // 有bug的浏览器会返回比0大的数字</span>
<span class="lnr"> 4559 </span>          document.getElementsByName( expando + <span class="Constant">0</span> ).length;
<span class="lnr"> 4560 </span>       assertGetIdNotName = !document.getElementById( expando );
<span class="lnr"> 4561 </span>
<span class="lnr"> 4562 </span><span class="Comment">       // Cleanup</span>
<span class="lnr"> 4563 </span><span class="Comment">       // 清理</span>
<span class="lnr"> 4564 </span>       docElem.removeChild( div );
<span class="lnr"> 4565 </span>
<span class="lnr"> 4566 </span>       <span class="Statement">return</span> pass;
<span class="lnr"> 4567 </span>    });
<span class="lnr"> 4568 </span>
<span class="lnr"> 4569 </span><span class="Comment">// If slice is not available, provide a backup</span>
<span class="lnr"> 4570 </span><span class="Comment">// 如果slice不可用,提供一个备份</span>
<span class="lnr"> 4571 </span><span class="Statement">try</span> {
<span class="lnr"> 4572 </span>    slice.call( docElem.childNodes, <span class="Constant">0</span> )[<span class="Constant">0</span>].nodeType;
<span class="lnr"> 4573 </span>} <span class="Statement">catch</span> ( e ) {
<span class="lnr"> 4574 </span>    slice = <span class="Identifier">function</span>( i ) {
<span class="lnr"> 4575 </span>       <span class="Type">var</span> elem, results = [];
<span class="lnr"> 4576 </span>       <span class="Statement">for</span> ( ; (elem = <span class="Type">this</span>[i]); i++ ) {
<span class="lnr"> 4577 </span>          results.push( elem );
<span class="lnr"> 4578 </span>       }
<span class="lnr"> 4579 </span>       <span class="Statement">return</span> results;
<span class="lnr"> 4580 </span>    };
<span class="lnr"> 4581 </span>}
<span class="lnr"> 4582 </span>
<span class="lnr"> 4583 </span><span class="Identifier">function</span> Sizzle( selector, context, results, seed ) {
<span class="lnr"> 4584 </span>    results = results || [];
<span class="lnr"> 4585 </span>    context = context || document;
<span class="lnr"> 4586 </span>    <span class="Type">var</span> match, elem, xml, m,
<span class="lnr"> 4587 </span>       nodeType = context.nodeType;
<span class="lnr"> 4588 </span>
<span class="lnr"> 4589 </span>    <span class="Statement">if</span> ( nodeType !== <span class="Constant">1</span> &amp;&amp; nodeType !== <span class="Constant">9</span> ) {
<span class="lnr"> 4590 </span>       <span class="Statement">return</span> [];
<span class="lnr"> 4591 </span>    }
<span class="lnr"> 4592 </span>
<span class="lnr"> 4593 </span>    <span class="Statement">if</span> ( !selector || <span class="Statement">typeof</span> selector !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 4594 </span>       <span class="Statement">return</span> results;
<span class="lnr"> 4595 </span>    }
<span class="lnr"> 4596 </span>
<span class="lnr"> 4597 </span>    xml = isXML( context );
<span class="lnr"> 4598 </span>
<span class="lnr"> 4599 </span>    <span class="Statement">if</span> ( !xml &amp;&amp; !seed ) {
<span class="lnr"> 4600 </span>       <span class="Statement">if</span> ( (match = rquickExpr.exec( selector )) ) {
<span class="lnr"> 4601 </span><span class="Comment">          // Speed-up: Sizzle(&quot;#ID&quot;)</span>
<span class="lnr"> 4602 </span><span class="Comment">          // 处理Sizzle(&quot;#ID&quot;)</span>
<span class="lnr"> 4603 </span>          <span class="Statement">if</span> ( (m = match[<span class="Constant">1</span>]) ) {
<span class="lnr"> 4604 </span>             <span class="Statement">if</span> ( nodeType === <span class="Constant">9</span> ) {
<span class="lnr"> 4605 </span>                elem = context.getElementById( m );
<span class="lnr"> 4606 </span><span class="Comment">                // Check parentNode to catch when Blackberry 4.6 returns</span>
<span class="lnr"> 4607 </span><span class="Comment">                // nodes that are no longer in the document #6963</span>
<span class="lnr"> 4608 </span>                <span class="Statement">if</span> ( elem &amp;&amp; elem.parentNode ) {
<span class="lnr"> 4609 </span><span class="Comment">                   // Handle the case where IE, Opera, and Webkit return items</span>
<span class="lnr"> 4610 </span><span class="Comment">                   // by name instead of ID</span>
<span class="lnr"> 4611 </span><span class="Comment">                   // 处理IE,Opera和Webkit浏览器返回根据name找到的对象</span>
<span class="lnr"> 4612 </span>                   <span class="Statement">if</span> ( elem.id === m ) {
<span class="lnr"> 4613 </span>                      results.push( elem );
<span class="lnr"> 4614 </span>                      <span class="Statement">return</span> results;
<span class="lnr"> 4615 </span>                   }
<span class="lnr"> 4616 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 4617 </span>                   <span class="Statement">return</span> results;
<span class="lnr"> 4618 </span>                }
<span class="lnr"> 4619 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 4620 </span><span class="Comment">                // Context is not a document</span>
<span class="lnr"> 4621 </span><span class="Comment">                // 上下文对象不是document</span>
<span class="lnr"> 4622 </span>                <span class="Statement">if</span> ( context.ownerDocument &amp;&amp; (elem = context.ownerDocument.getElementById( m )) &amp;&amp;
<span class="lnr"> 4623 </span>                   contains( context, elem ) &amp;&amp; elem.id === m ) {
<span class="lnr"> 4624 </span>                   results.push( elem );
<span class="lnr"> 4625 </span>                   <span class="Statement">return</span> results;
<span class="lnr"> 4626 </span>                }
<span class="lnr"> 4627 </span>             }
<span class="lnr"> 4628 </span>
<span class="lnr"> 4629 </span><span class="Comment">          // Speed-up: Sizzle(&quot;TAG&quot;)</span>
<span class="lnr"> 4630 </span><span class="Comment">          // 处理Sizzle(&quot;TAG&quot;)</span>
<span class="lnr"> 4631 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( match[<span class="Constant">2</span>] ) {
<span class="lnr"> 4632 </span>             push.apply( results, slice.call(context.getElementsByTagName( selector ), <span class="Constant">0</span>) );
<span class="lnr"> 4633 </span>             <span class="Statement">return</span> results;
<span class="lnr"> 4634 </span>
<span class="lnr"> 4635 </span><span class="Comment">          // Speed-up: Sizzle(&quot;.CLASS&quot;)</span>
<span class="lnr"> 4636 </span><span class="Comment">          // 处理Sizzle(&quot;.CLASS&quot;)</span>
<span class="lnr"> 4637 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( (m = match[<span class="Constant">3</span>]) &amp;&amp; assertUsableClassName &amp;&amp; context.getElementsByClassName ) {
<span class="lnr"> 4638 </span>             push.apply( results, slice.call(context.getElementsByClassName( m ), <span class="Constant">0</span>) );
<span class="lnr"> 4639 </span>             <span class="Statement">return</span> results;
<span class="lnr"> 4640 </span>          }
<span class="lnr"> 4641 </span>       }
<span class="lnr"> 4642 </span>    }
<span class="lnr"> 4643 </span>
<span class="lnr"> 4644 </span><span class="Comment">    // All others</span>
<span class="lnr"> 4645 </span><span class="Comment">    // 所有其他的</span>
<span class="lnr"> 4646 </span>    <span class="Statement">return</span> select( selector, context, results, seed, xml );
<span class="lnr"> 4647 </span>}
<span class="lnr"> 4648 </span>
<span class="lnr"> 4649 </span>Sizzle.matches = <span class="Identifier">function</span>( expr, elements ) {
<span class="lnr"> 4650 </span>    <span class="Statement">return</span> Sizzle( expr, <span class="Type">null</span>, <span class="Type">null</span>, elements );
<span class="lnr"> 4651 </span>};
<span class="lnr"> 4652 </span>
<span class="lnr"> 4653 </span>Sizzle.matchesSelector = <span class="Identifier">function</span>( elem, expr ) {
<span class="lnr"> 4654 </span>    <span class="Statement">return</span> Sizzle( expr, <span class="Type">null</span>, <span class="Type">null</span>, [ elem ] ).length &gt; <span class="Constant">0</span>;
<span class="lnr"> 4655 </span>};
<span class="lnr"> 4656 </span>
<span class="lnr"> 4657 </span><span class="Comment">// Returns a function to use in pseudos for input types</span>
<span class="lnr"> 4658 </span><span class="Identifier">function</span> createInputPseudo( type ) {
<span class="lnr"> 4659 </span>    <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4660 </span>       <span class="Type">var</span> name = elem.nodeName.toLowerCase();
<span class="lnr"> 4661 </span>       <span class="Statement">return</span> name === <span class="Constant">&quot;input&quot;</span> &amp;&amp; elem.type === type;
<span class="lnr"> 4662 </span>    };
<span class="lnr"> 4663 </span>}
<span class="lnr"> 4664 </span>
<span class="lnr"> 4665 </span><span class="Comment">// Returns a function to use in pseudos for buttons</span>
<span class="lnr"> 4666 </span><span class="Identifier">function</span> createButtonPseudo( type ) {
<span class="lnr"> 4667 </span>    <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4668 </span>       <span class="Type">var</span> name = elem.nodeName.toLowerCase();
<span class="lnr"> 4669 </span>       <span class="Statement">return</span> (name === <span class="Constant">&quot;input&quot;</span> || name === <span class="Constant">&quot;button&quot;</span>) &amp;&amp; elem.type === type;
<span class="lnr"> 4670 </span>    };
<span class="lnr"> 4671 </span>}
<span class="lnr"> 4672 </span>
<span class="lnr"> 4673 </span><span class="Comment">/**</span>
<span class="lnr"> 4674 </span><span class="Comment"> * Utility function for retrieving the text value of an array of DOM nodes</span>
<span class="lnr"> 4675 </span><span class="Comment"> * 从一个DOM节点数组获取文本值的工具方法</span>
<span class="lnr"> 4676 </span><span class="Comment"> * </span><span class="Special">@param</span><span class="Comment"> </span><span class="Identifier">{Array|Element}</span><span class="Comment"> elem</span>
<span class="lnr"> 4677 </span><span class="Comment"> </span><span class="Comment">*/</span>
<span class="lnr"> 4678 </span>getText = Sizzle.getText = <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4679 </span>    <span class="Type">var</span> node,
<span class="lnr"> 4680 </span>       ret = <span class="Constant">&quot;&quot;</span>,
<span class="lnr"> 4681 </span>       i = <span class="Constant">0</span>,
<span class="lnr"> 4682 </span>       nodeType = elem.nodeType;
<span class="lnr"> 4683 </span>
<span class="lnr"> 4684 </span>    <span class="Statement">if</span> ( nodeType ) {
<span class="lnr"> 4685 </span>       <span class="Statement">if</span> ( nodeType === <span class="Constant">1</span> || nodeType === <span class="Constant">9</span> || nodeType === <span class="Constant">11</span> ) {
<span class="lnr"> 4686 </span><span class="Comment">          // Use textContent for elements</span>
<span class="lnr"> 4687 </span><span class="Comment">          // innerText usage removed for consistency of new lines (see #11153)</span>
<span class="lnr"> 4688 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem.textContent === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 4689 </span>             <span class="Statement">return</span> elem.textContent;
<span class="lnr"> 4690 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 4691 </span><span class="Comment">             // Traverse its children</span>
<span class="lnr"> 4692 </span>             <span class="Statement">for</span> ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
<span class="lnr"> 4693 </span>                ret += getText( elem );
<span class="lnr"> 4694 </span>             }
<span class="lnr"> 4695 </span>          }
<span class="lnr"> 4696 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( nodeType === <span class="Constant">3</span> || nodeType === <span class="Constant">4</span> ) {
<span class="lnr"> 4697 </span>          <span class="Statement">return</span> elem.nodeValue;
<span class="lnr"> 4698 </span>       }
<span class="lnr"> 4699 </span><span class="Comment">       // Do not include comment or processing instruction nodes</span>
<span class="lnr"> 4700 </span>    } <span class="Statement">else</span> {
<span class="lnr"> 4701 </span>
<span class="lnr"> 4702 </span><span class="Comment">       // If no nodeType, this is expected to be an array</span>
<span class="lnr"> 4703 </span>       <span class="Statement">for</span> ( ; (node = elem[i]); i++ ) {
<span class="lnr"> 4704 </span><span class="Comment">          // Do not traverse comment nodes</span>
<span class="lnr"> 4705 </span>          ret += getText( node );
<span class="lnr"> 4706 </span>       }
<span class="lnr"> 4707 </span>    }
<span class="lnr"> 4708 </span>    <span class="Statement">return</span> ret;
<span class="lnr"> 4709 </span>};
<span class="lnr"> 4710 </span>
<span class="lnr"> 4711 </span>isXML = Sizzle.isXML = <span class="Identifier">function</span> isXML( elem ) {
<span class="lnr"> 4712 </span><span class="Comment">    // documentElement is verified for cases where it doesn't yet exist</span>
<span class="lnr"> 4713 </span><span class="Comment">    // (such as loading iframes in IE - #4833)</span>
<span class="lnr"> 4714 </span>    <span class="Type">var</span> documentElement = elem &amp;&amp; (elem.ownerDocument || elem).documentElement;
<span class="lnr"> 4715 </span>    <span class="Statement">return</span> documentElement ? documentElement.nodeName !== <span class="Constant">&quot;HTML&quot;</span> : <span class="Constant">false</span>;
<span class="lnr"> 4716 </span>};
<span class="lnr"> 4717 </span>
<span class="lnr"> 4718 </span><span class="Comment">// Element contains another</span>
<span class="lnr"> 4719 </span>contains = Sizzle.contains = docElem.contains ?
<span class="lnr"> 4720 </span>    <span class="Identifier">function</span>( a, b ) {
<span class="lnr"> 4721 </span>       <span class="Type">var</span> adown = a.nodeType === <span class="Constant">9</span> ? a.<span class="Statement">documentElement</span> : a,
<span class="lnr"> 4722 </span>          bup = b &amp;&amp; b.parentNode;
<span class="lnr"> 4723 </span>       <span class="Statement">return</span> a === bup || !!( bup &amp;&amp; bup.nodeType === <span class="Constant">1</span> &amp;&amp; adown.contains &amp;&amp; adown.contains(bup) );
<span class="lnr"> 4724 </span>    } :
<span class="lnr"> 4725 </span>    docElem.compareDocumentPosition ?
<span class="lnr"> 4726 </span>    <span class="Identifier">function</span>( a, b ) {
<span class="lnr"> 4727 </span>       <span class="Statement">return</span> b &amp;&amp; !!( a.compareDocumentPosition( b ) &amp; <span class="Constant">16</span> );
<span class="lnr"> 4728 </span>    } :
<span class="lnr"> 4729 </span>    <span class="Identifier">function</span>( a, b ) {
<span class="lnr"> 4730 </span>       <span class="Statement">while</span> ( (b = b.parentNode) ) {
<span class="lnr"> 4731 </span>          <span class="Statement">if</span> ( b === a ) {
<span class="lnr"> 4732 </span>             <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 4733 </span>          }
<span class="lnr"> 4734 </span>       }
<span class="lnr"> 4735 </span>       <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 4736 </span>    };
<span class="lnr"> 4737 </span>
<span class="lnr"> 4738 </span>Sizzle.attr = <span class="Identifier">function</span>( elem, name ) {
<span class="lnr"> 4739 </span>    <span class="Type">var</span> attr,
<span class="lnr"> 4740 </span>       xml = isXML( elem );
<span class="lnr"> 4741 </span>
<span class="lnr"> 4742 </span>    <span class="Statement">if</span> ( !xml ) {
<span class="lnr"> 4743 </span>       name = name.toLowerCase();
<span class="lnr"> 4744 </span>    }
<span class="lnr"> 4745 </span>    <span class="Statement">if</span> ( Expr.attrHandle[ name ] ) {
<span class="lnr"> 4746 </span>       <span class="Statement">return</span> Expr.attrHandle[ name ]( elem );
<span class="lnr"> 4747 </span>    }
<span class="lnr"> 4748 </span>    <span class="Statement">if</span> ( assertAttributes || xml ) {
<span class="lnr"> 4749 </span>       <span class="Statement">return</span> elem.getAttribute( name );
<span class="lnr"> 4750 </span>    }
<span class="lnr"> 4751 </span>    attr = elem.getAttributeNode( name );
<span class="lnr"> 4752 </span>    <span class="Statement">return</span> attr ?
<span class="lnr"> 4753 </span>       <span class="Statement">typeof</span> elem[ name ] === <span class="Constant">&quot;boolean&quot;</span> ?
<span class="lnr"> 4754 </span>          elem[ name ] ? name : <span class="Type">null</span> :
<span class="lnr"> 4755 </span>          attr.specified ? attr.<span class="Statement">value</span> : <span class="Type">null</span> :
<span class="lnr"> 4756 </span>       <span class="Type">null</span>;
<span class="lnr"> 4757 </span>};
<span class="lnr"> 4758 </span>
<span class="lnr"> 4759 </span>Expr = Sizzle.selectors = {
<span class="lnr"> 4760 </span>
<span class="lnr"> 4761 </span><span class="Comment">    // Can be adjusted by the user</span>
<span class="lnr"> 4762 </span><span class="Comment">    // 可由用户定义</span>
<span class="lnr"> 4763 </span>    <span class="Statement">cacheLength</span>: <span class="Constant">50</span>,
<span class="lnr"> 4764 </span>
<span class="lnr"> 4765 </span>    <span class="Statement">createPseudo</span>: markFunction,
<span class="lnr"> 4766 </span>
<span class="lnr"> 4767 </span>    <span class="Statement">match</span>: matchExpr,
<span class="lnr"> 4768 </span>
<span class="lnr"> 4769 </span>    <span class="Statement">order</span>: <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;ID|TAG&quot;</span> +
<span class="lnr"> 4770 </span>       (assertUsableName ? <span class="Constant">&quot;|NAME&quot;</span> : <span class="Constant">&quot;&quot;</span>) +
<span class="lnr"> 4771 </span>       (assertUsableClassName ? <span class="Constant">&quot;|CLASS&quot;</span> : <span class="Constant">&quot;&quot;</span>)
<span class="lnr"> 4772 </span>    ),
<span class="lnr"> 4773 </span>
<span class="lnr"> 4774 </span><span class="Comment">    // IE6/7 return a modified href</span>
<span class="lnr"> 4775 </span><span class="Comment">    // IE6/7返回一个修改过的href</span>
<span class="lnr"> 4776 </span>    <span class="Statement">attrHandle</span>: assertHrefNotNormalized ?
<span class="lnr"> 4777 </span>       {} :
<span class="lnr"> 4778 </span>       {
<span class="lnr"> 4779 </span>          <span class="Constant">&quot;href&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4780 </span>             <span class="Statement">return</span> elem.getAttribute( <span class="Constant">&quot;href&quot;</span>, <span class="Constant">2</span> );
<span class="lnr"> 4781 </span>          },
<span class="lnr"> 4782 </span>          <span class="Constant">&quot;type&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4783 </span>             <span class="Statement">return</span> elem.getAttribute(<span class="Constant">&quot;type&quot;</span>);
<span class="lnr"> 4784 </span>          }
<span class="lnr"> 4785 </span>       },
<span class="lnr"> 4786 </span>
<span class="lnr"> 4787 </span>    <span class="Statement">find</span>: {
<span class="lnr"> 4788 </span>       <span class="Constant">&quot;ID&quot;</span>: assertGetIdNotName ?
<span class="lnr"> 4789 </span>          <span class="Identifier">function</span>( id, context, xml ) {
<span class="lnr"> 4790 </span>             <span class="Statement">if</span> ( <span class="Statement">typeof</span> context.getElementById !== strundefined &amp;&amp; !xml ) {
<span class="lnr"> 4791 </span>                <span class="Type">var</span> m = context.getElementById( id );
<span class="lnr"> 4792 </span><span class="Comment">                // Check parentNode to catch when Blackberry 4.6 returns</span>
<span class="lnr"> 4793 </span><span class="Comment">                // nodes that are no longer in the document #6963</span>
<span class="lnr"> 4794 </span>                <span class="Statement">return</span> m &amp;&amp; m.parentNode ? [m] : [];
<span class="lnr"> 4795 </span>             }
<span class="lnr"> 4796 </span>          } :
<span class="lnr"> 4797 </span>          <span class="Identifier">function</span>( id, context, xml ) {
<span class="lnr"> 4798 </span>             <span class="Statement">if</span> ( <span class="Statement">typeof</span> context.getElementById !== strundefined &amp;&amp; !xml ) {
<span class="lnr"> 4799 </span>                <span class="Type">var</span> m = context.getElementById( id );
<span class="lnr"> 4800 </span>
<span class="lnr"> 4801 </span>                <span class="Statement">return</span> m ?
<span class="lnr"> 4802 </span>                   m.id === id || <span class="Statement">typeof</span> m.getAttributeNode !== strundefined &amp;&amp; m.getAttributeNode(<span class="Constant">&quot;id&quot;</span>).value === id ?
<span class="lnr"> 4803 </span>                      [m] :
<span class="lnr"> 4804 </span>                      <span class="Type">undefined</span> :
<span class="lnr"> 4805 </span>                   [];
<span class="lnr"> 4806 </span>             }
<span class="lnr"> 4807 </span>          },
<span class="lnr"> 4808 </span>
<span class="lnr"> 4809 </span>       <span class="Constant">&quot;TAG&quot;</span>: assertTagNameNoComments ?
<span class="lnr"> 4810 </span>          <span class="Identifier">function</span>( tag, context ) {
<span class="lnr"> 4811 </span>             <span class="Statement">if</span> ( <span class="Statement">typeof</span> context.getElementsByTagName !== strundefined ) {
<span class="lnr"> 4812 </span>                <span class="Statement">return</span> context.getElementsByTagName( tag );
<span class="lnr"> 4813 </span>             }
<span class="lnr"> 4814 </span>          } :
<span class="lnr"> 4815 </span>          <span class="Identifier">function</span>( tag, context ) {
<span class="lnr"> 4816 </span>             <span class="Type">var</span> results = context.getElementsByTagName( tag );
<span class="lnr"> 4817 </span>
<span class="lnr"> 4818 </span><span class="Comment">             // Filter out possible comments</span>
<span class="lnr"> 4819 </span>             <span class="Statement">if</span> ( tag === <span class="Constant">&quot;*&quot;</span> ) {
<span class="lnr"> 4820 </span>                <span class="Type">var</span> elem,
<span class="lnr"> 4821 </span>                   tmp = [],
<span class="lnr"> 4822 </span>                   i = <span class="Constant">0</span>;
<span class="lnr"> 4823 </span>
<span class="lnr"> 4824 </span>                <span class="Statement">for</span> ( ; (elem = results[i]); i++ ) {
<span class="lnr"> 4825 </span>                   <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 4826 </span>                      tmp.push( elem );
<span class="lnr"> 4827 </span>                   }
<span class="lnr"> 4828 </span>                }
<span class="lnr"> 4829 </span>
<span class="lnr"> 4830 </span>                <span class="Statement">return</span> tmp;
<span class="lnr"> 4831 </span>             }
<span class="lnr"> 4832 </span>             <span class="Statement">return</span> results;
<span class="lnr"> 4833 </span>          },
<span class="lnr"> 4834 </span>
<span class="lnr"> 4835 </span>       <span class="Constant">&quot;NAME&quot;</span>: <span class="Identifier">function</span>( tag, context ) {
<span class="lnr"> 4836 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> context.getElementsByName !== strundefined ) {
<span class="lnr"> 4837 </span>             <span class="Statement">return</span> context.getElementsByName( name );
<span class="lnr"> 4838 </span>          }
<span class="lnr"> 4839 </span>       },
<span class="lnr"> 4840 </span>
<span class="lnr"> 4841 </span>       <span class="Constant">&quot;CLASS&quot;</span>: <span class="Identifier">function</span>( className, context, xml ) {
<span class="lnr"> 4842 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> context.getElementsByClassName !== strundefined &amp;&amp; !xml ) {
<span class="lnr"> 4843 </span>             <span class="Statement">return</span> context.getElementsByClassName( className );
<span class="lnr"> 4844 </span>          }
<span class="lnr"> 4845 </span>       }
<span class="lnr"> 4846 </span>    },
<span class="lnr"> 4847 </span>
<span class="lnr"> 4848 </span><span class="Comment">    // 关系</span>
<span class="lnr"> 4849 </span>    <span class="Statement">relative</span>: {
<span class="lnr"> 4850 </span>       <span class="Constant">&quot;&gt;&quot;</span>: { <span class="Statement">dir</span>: <span class="Constant">&quot;parentNode&quot;</span>, <span class="Statement">first</span>: <span class="Constant">true</span> },
<span class="lnr"> 4851 </span>       <span class="Constant">&quot; &quot;</span>: { <span class="Statement">dir</span>: <span class="Constant">&quot;parentNode&quot;</span> },
<span class="lnr"> 4852 </span>       <span class="Constant">&quot;+&quot;</span>: { <span class="Statement">dir</span>: <span class="Constant">&quot;previousSibling&quot;</span>, <span class="Statement">first</span>: <span class="Constant">true</span> },
<span class="lnr"> 4853 </span>       <span class="Constant">&quot;~&quot;</span>: { <span class="Statement">dir</span>: <span class="Constant">&quot;previousSibling&quot;</span> }
<span class="lnr"> 4854 </span>    },
<span class="lnr"> 4855 </span>
<span class="lnr"> 4856 </span><span class="Comment">    // 过滤器</span>
<span class="lnr"> 4857 </span>    <span class="Statement">preFilter</span>: {
<span class="lnr"> 4858 </span>       <span class="Constant">&quot;ATTR&quot;</span>: <span class="Identifier">function</span>( match ) {
<span class="lnr"> 4859 </span>          match[<span class="Constant">1</span>] = match[<span class="Constant">1</span>].replace( rbackslash, <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 4860 </span>
<span class="lnr"> 4861 </span><span class="Comment">          // Move the given value to match[3] whether quoted or unquoted</span>
<span class="lnr"> 4862 </span>          match[<span class="Constant">3</span>] = ( match[<span class="Constant">4</span>] || match[<span class="Constant">5</span>] || <span class="Constant">&quot;&quot;</span> ).replace( rbackslash, <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 4863 </span>
<span class="lnr"> 4864 </span>          <span class="Statement">if</span> ( match[<span class="Constant">2</span>] === <span class="Constant">&quot;~=&quot;</span> ) {
<span class="lnr"> 4865 </span>             match[<span class="Constant">3</span>] = <span class="Constant">&quot; &quot;</span> + match[<span class="Constant">3</span>] + <span class="Constant">&quot; &quot;</span>;
<span class="lnr"> 4866 </span>          }
<span class="lnr"> 4867 </span>
<span class="lnr"> 4868 </span>          <span class="Statement">return</span> match.slice( <span class="Constant">0</span>, <span class="Constant">4</span> );
<span class="lnr"> 4869 </span>       },
<span class="lnr"> 4870 </span>
<span class="lnr"> 4871 </span>       <span class="Constant">&quot;CHILD&quot;</span>: <span class="Identifier">function</span>( match ) {
<span class="lnr"> 4872 </span>          <span class="Comment">/* matches from matchExpr.CHILD</span>
<span class="lnr"> 4873 </span><span class="Comment">             1 type (only|nth|...)</span>
<span class="lnr"> 4874 </span><span class="Comment">             2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)</span>
<span class="lnr"> 4875 </span><span class="Comment">             3 xn-component of xn+y argument ([+-]?\d*n|)</span>
<span class="lnr"> 4876 </span><span class="Comment">             4 sign of xn-component</span>
<span class="lnr"> 4877 </span><span class="Comment">             5 x of xn-component</span>
<span class="lnr"> 4878 </span><span class="Comment">             6 sign of y-component</span>
<span class="lnr"> 4879 </span><span class="Comment">             7 y of y-component</span>
<span class="lnr"> 4880 </span><span class="Comment">          */</span>
<span class="lnr"> 4881 </span>          match[<span class="Constant">1</span>] = match[<span class="Constant">1</span>].toLowerCase();
<span class="lnr"> 4882 </span>
<span class="lnr"> 4883 </span>          <span class="Statement">if</span> ( match[<span class="Constant">1</span>] === <span class="Constant">&quot;nth&quot;</span> ) {
<span class="lnr"> 4884 </span><span class="Comment">             // nth-child requires argument</span>
<span class="lnr"> 4885 </span>             <span class="Statement">if</span> ( !match[<span class="Constant">2</span>] ) {
<span class="lnr"> 4886 </span>                Sizzle.error( match[<span class="Constant">0</span>] );
<span class="lnr"> 4887 </span>             }
<span class="lnr"> 4888 </span>
<span class="lnr"> 4889 </span><span class="Comment">             // numeric x and y parameters for Expr.filter.CHILD</span>
<span class="lnr"> 4890 </span><span class="Comment">             // remember that false/true cast respectively to 0/1</span>
<span class="lnr"> 4891 </span>             match[<span class="Constant">3</span>] = +( match[<span class="Constant">3</span>] ? match[<span class="Constant">4</span>] + (match[<span class="Constant">5</span>] || <span class="Constant">1</span>) : <span class="Constant">2</span> * ( match[<span class="Constant">2</span>] === <span class="Constant">&quot;even&quot;</span> || match[<span class="Constant">2</span>] === <span class="Constant">&quot;odd&quot;</span> ) );
<span class="lnr"> 4892 </span>             match[<span class="Constant">4</span>] = +( ( match[<span class="Constant">6</span>] + match[<span class="Constant">7</span>] ) || match[<span class="Constant">2</span>] === <span class="Constant">&quot;odd&quot;</span> );
<span class="lnr"> 4893 </span>
<span class="lnr"> 4894 </span><span class="Comment">          // other types prohibit arguments</span>
<span class="lnr"> 4895 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( match[<span class="Constant">2</span>] ) {
<span class="lnr"> 4896 </span>             Sizzle.error( match[<span class="Constant">0</span>] );
<span class="lnr"> 4897 </span>          }
<span class="lnr"> 4898 </span>
<span class="lnr"> 4899 </span>          <span class="Statement">return</span> match;
<span class="lnr"> 4900 </span>       },
<span class="lnr"> 4901 </span>
<span class="lnr"> 4902 </span>       <span class="Constant">&quot;PSEUDO&quot;</span>: <span class="Identifier">function</span>( match, context, xml ) {
<span class="lnr"> 4903 </span>          <span class="Type">var</span> unquoted, excess;
<span class="lnr"> 4904 </span>          <span class="Statement">if</span> ( matchExpr[<span class="Constant">&quot;CHILD&quot;</span>].test( match[<span class="Constant">0</span>] ) ) {
<span class="lnr"> 4905 </span>             <span class="Statement">return</span> <span class="Type">null</span>;
<span class="lnr"> 4906 </span>          }
<span class="lnr"> 4907 </span>
<span class="lnr"> 4908 </span>          <span class="Statement">if</span> ( match[<span class="Constant">3</span>] ) {
<span class="lnr"> 4909 </span>             match[<span class="Constant">2</span>] = match[<span class="Constant">3</span>];
<span class="lnr"> 4910 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( (unquoted = match[<span class="Constant">4</span>]) ) {
<span class="lnr"> 4911 </span><span class="Comment">             // Only check arguments that contain a pseudo</span>
<span class="lnr"> 4912 </span>             <span class="Statement">if</span> ( rpseudo.test(unquoted) &amp;&amp;
<span class="lnr"> 4913 </span><span class="Comment">                // Get excess from tokenize (recursively)</span>
<span class="lnr"> 4914 </span>                (excess = tokenize( unquoted, context, xml, <span class="Constant">true</span> )) &amp;&amp;
<span class="lnr"> 4915 </span><span class="Comment">                // advance to the next closing parenthesis</span>
<span class="lnr"> 4916 </span>                (excess = unquoted.indexOf( <span class="Constant">&quot;)&quot;</span>, unquoted.length - excess ) - unquoted.length) ) {
<span class="lnr"> 4917 </span>
<span class="lnr"> 4918 </span><span class="Comment">                // excess is a negative index</span>
<span class="lnr"> 4919 </span>                unquoted = unquoted.slice( <span class="Constant">0</span>, excess );
<span class="lnr"> 4920 </span>                match[<span class="Constant">0</span>] = match[<span class="Constant">0</span>].slice( <span class="Constant">0</span>, excess );
<span class="lnr"> 4921 </span>             }
<span class="lnr"> 4922 </span>             match[<span class="Constant">2</span>] = unquoted;
<span class="lnr"> 4923 </span>          }
<span class="lnr"> 4924 </span>
<span class="lnr"> 4925 </span><span class="Comment">          // Return only captures needed by the pseudo filter method (type and argument)</span>
<span class="lnr"> 4926 </span>          <span class="Statement">return</span> match.slice( <span class="Constant">0</span>, <span class="Constant">3</span> );
<span class="lnr"> 4927 </span>       }
<span class="lnr"> 4928 </span>    },
<span class="lnr"> 4929 </span>
<span class="lnr"> 4930 </span>    <span class="Statement">filter</span>: {
<span class="lnr"> 4931 </span>       <span class="Constant">&quot;ID&quot;</span>: assertGetIdNotName ?
<span class="lnr"> 4932 </span>          <span class="Identifier">function</span>( id ) {
<span class="lnr"> 4933 </span>             id = id.replace( rbackslash, <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 4934 </span>             <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4935 </span>                <span class="Statement">return</span> elem.getAttribute(<span class="Constant">&quot;id&quot;</span>) === id;
<span class="lnr"> 4936 </span>             };
<span class="lnr"> 4937 </span>          } :
<span class="lnr"> 4938 </span>          <span class="Identifier">function</span>( id ) {
<span class="lnr"> 4939 </span>             id = id.replace( rbackslash, <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 4940 </span>             <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4941 </span>                <span class="Type">var</span> node = <span class="Statement">typeof</span> elem.getAttributeNode !== strundefined &amp;&amp; elem.getAttributeNode(<span class="Constant">&quot;id&quot;</span>);
<span class="lnr"> 4942 </span>                <span class="Statement">return</span> node &amp;&amp; node.value === id;
<span class="lnr"> 4943 </span>             };
<span class="lnr"> 4944 </span>          },
<span class="lnr"> 4945 </span>
<span class="lnr"> 4946 </span>       <span class="Constant">&quot;TAG&quot;</span>: <span class="Identifier">function</span>( nodeName ) {
<span class="lnr"> 4947 </span>          <span class="Statement">if</span> ( nodeName === <span class="Constant">&quot;*&quot;</span> ) {
<span class="lnr"> 4948 </span>             <span class="Statement">return</span> <span class="Identifier">function</span>() { <span class="Statement">return</span> <span class="Constant">true</span>; };
<span class="lnr"> 4949 </span>          }
<span class="lnr"> 4950 </span>          nodeName = nodeName.replace( rbackslash, <span class="Constant">&quot;&quot;</span> ).toLowerCase();
<span class="lnr"> 4951 </span>
<span class="lnr"> 4952 </span>          <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4953 </span>             <span class="Statement">return</span> elem.nodeName &amp;&amp; elem.nodeName.toLowerCase() === nodeName;
<span class="lnr"> 4954 </span>          };
<span class="lnr"> 4955 </span>       },
<span class="lnr"> 4956 </span>
<span class="lnr"> 4957 </span>       <span class="Constant">&quot;CLASS&quot;</span>: <span class="Identifier">function</span>( className ) {
<span class="lnr"> 4958 </span>          <span class="Type">var</span> pattern = classCache[ expando ][ className ];
<span class="lnr"> 4959 </span>          <span class="Statement">if</span> ( !pattern ) {
<span class="lnr"> 4960 </span>             pattern = classCache( className, <span class="Statement">new</span> <span class="Special">RegExp</span>(<span class="Constant">&quot;(^|&quot;</span> + whitespace + <span class="Constant">&quot;)&quot;</span> + className + <span class="Constant">&quot;(&quot;</span> + whitespace + <span class="Constant">&quot;|$)&quot;</span>) );
<span class="lnr"> 4961 </span>          }
<span class="lnr"> 4962 </span>          <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4963 </span>             <span class="Statement">return</span> pattern.test( elem.className || (<span class="Statement">typeof</span> elem.getAttribute !== strundefined &amp;&amp; elem.getAttribute(<span class="Constant">&quot;class&quot;</span>)) || <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 4964 </span>          };
<span class="lnr"> 4965 </span>       },
<span class="lnr"> 4966 </span>
<span class="lnr"> 4967 </span>       <span class="Constant">&quot;ATTR&quot;</span>: <span class="Identifier">function</span>( name, operator, check ) {
<span class="lnr"> 4968 </span>          <span class="Statement">if</span> ( !operator ) {
<span class="lnr"> 4969 </span>             <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4970 </span>                <span class="Statement">return</span> Sizzle.attr( elem, name ) != <span class="Type">null</span>;
<span class="lnr"> 4971 </span>             };
<span class="lnr"> 4972 </span>          }
<span class="lnr"> 4973 </span>
<span class="lnr"> 4974 </span>          <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 4975 </span>             <span class="Type">var</span> result = Sizzle.attr( elem, name ),
<span class="lnr"> 4976 </span>                value = result + <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 4977 </span>
<span class="lnr"> 4978 </span>             <span class="Statement">if</span> ( result == <span class="Type">null</span> ) {
<span class="lnr"> 4979 </span>                <span class="Statement">return</span> operator === <span class="Constant">&quot;!=&quot;</span>;
<span class="lnr"> 4980 </span>             }
<span class="lnr"> 4981 </span>
<span class="lnr"> 4982 </span>             <span class="Statement">switch</span> ( operator ) {
<span class="lnr"> 4983 </span>                <span class="Statement">case</span> <span class="Constant">&quot;=&quot;</span>:
<span class="lnr"> 4984 </span>                   <span class="Statement">return</span> value === check;
<span class="lnr"> 4985 </span>                <span class="Statement">case</span> <span class="Constant">&quot;!=&quot;</span>:
<span class="lnr"> 4986 </span>                   <span class="Statement">return</span> value !== check;
<span class="lnr"> 4987 </span>                <span class="Statement">case</span> <span class="Constant">&quot;^=&quot;</span>:
<span class="lnr"> 4988 </span>                   <span class="Statement">return</span> check &amp;&amp; value.indexOf( check ) === <span class="Constant">0</span>;
<span class="lnr"> 4989 </span>                <span class="Statement">case</span> <span class="Constant">&quot;*=&quot;</span>:
<span class="lnr"> 4990 </span>                   <span class="Statement">return</span> check &amp;&amp; value.indexOf( check ) &gt; -<span class="Constant">1</span>;
<span class="lnr"> 4991 </span>                <span class="Statement">case</span> <span class="Constant">&quot;$=&quot;</span>:
<span class="lnr"> 4992 </span>                   <span class="Statement">return</span> check &amp;&amp; value.substr( value.length - check.length ) === check;
<span class="lnr"> 4993 </span>                <span class="Statement">case</span> <span class="Constant">&quot;~=&quot;</span>:
<span class="lnr"> 4994 </span>                   <span class="Statement">return</span> ( <span class="Constant">&quot; &quot;</span> + value + <span class="Constant">&quot; &quot;</span> ).indexOf( check ) &gt; -<span class="Constant">1</span>;
<span class="lnr"> 4995 </span>                <span class="Statement">case</span> <span class="Constant">&quot;|=&quot;</span>:
<span class="lnr"> 4996 </span>                   <span class="Statement">return</span> value === check || value.substr( <span class="Constant">0</span>, check.length + <span class="Constant">1</span> ) === check + <span class="Constant">&quot;-&quot;</span>;
<span class="lnr"> 4997 </span>             }
<span class="lnr"> 4998 </span>          };
<span class="lnr"> 4999 </span>       },
<span class="lnr"> 5000 </span>
<span class="lnr"> 5001 </span>       <span class="Constant">&quot;CHILD&quot;</span>: <span class="Identifier">function</span>( type, argument, first, last ) {
<span class="lnr"> 5002 </span>
<span class="lnr"> 5003 </span>          <span class="Statement">if</span> ( type === <span class="Constant">&quot;nth&quot;</span> ) {
<span class="lnr"> 5004 </span>             <span class="Type">var</span> doneName = done++;
<span class="lnr"> 5005 </span>
<span class="lnr"> 5006 </span>             <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5007 </span>                <span class="Type">var</span> parent, diff,
<span class="lnr"> 5008 </span>                   count = <span class="Constant">0</span>,
<span class="lnr"> 5009 </span>                   node = elem;
<span class="lnr"> 5010 </span>
<span class="lnr"> 5011 </span>                <span class="Statement">if</span> ( first === <span class="Constant">1</span> &amp;&amp; last === <span class="Constant">0</span> ) {
<span class="lnr"> 5012 </span>                   <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 5013 </span>                }
<span class="lnr"> 5014 </span>
<span class="lnr"> 5015 </span>                parent = elem.parentNode;
<span class="lnr"> 5016 </span>
<span class="lnr"> 5017 </span>                <span class="Statement">if</span> ( parent &amp;&amp; (parent[ expando ] !== doneName || !elem.sizset) ) {
<span class="lnr"> 5018 </span>                   <span class="Statement">for</span> ( node = parent.firstChild; node; node = node.nextSibling ) {
<span class="lnr"> 5019 </span>                      <span class="Statement">if</span> ( node.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 5020 </span>                         node.sizset = ++count;
<span class="lnr"> 5021 </span>                         <span class="Statement">if</span> ( node === elem ) {
<span class="lnr"> 5022 </span>                            <span class="Statement">break</span>;
<span class="lnr"> 5023 </span>                         }
<span class="lnr"> 5024 </span>                      }
<span class="lnr"> 5025 </span>                   }
<span class="lnr"> 5026 </span>
<span class="lnr"> 5027 </span>                   parent[ expando ] = doneName;
<span class="lnr"> 5028 </span>                }
<span class="lnr"> 5029 </span>
<span class="lnr"> 5030 </span>                diff = elem.sizset - last;
<span class="lnr"> 5031 </span>
<span class="lnr"> 5032 </span>                <span class="Statement">if</span> ( first === <span class="Constant">0</span> ) {
<span class="lnr"> 5033 </span>                   <span class="Statement">return</span> diff === <span class="Constant">0</span>;
<span class="lnr"> 5034 </span>
<span class="lnr"> 5035 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 5036 </span>                   <span class="Statement">return</span> ( diff % first === <span class="Constant">0</span> &amp;&amp; diff / first &gt;= <span class="Constant">0</span> );
<span class="lnr"> 5037 </span>                }
<span class="lnr"> 5038 </span>             };
<span class="lnr"> 5039 </span>          }
<span class="lnr"> 5040 </span>
<span class="lnr"> 5041 </span>          <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5042 </span>             <span class="Type">var</span> node = elem;
<span class="lnr"> 5043 </span>
<span class="lnr"> 5044 </span>             <span class="Statement">switch</span> ( type ) {
<span class="lnr"> 5045 </span>                <span class="Statement">case</span> <span class="Constant">&quot;only&quot;</span>:
<span class="lnr"> 5046 </span>                <span class="Statement">case</span> <span class="Constant">&quot;first&quot;</span>:
<span class="lnr"> 5047 </span>                   <span class="Statement">while</span> ( (node = node.previousSibling) ) {
<span class="lnr"> 5048 </span>                      <span class="Statement">if</span> ( node.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 5049 </span>                         <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 5050 </span>                      }
<span class="lnr"> 5051 </span>                   }
<span class="lnr"> 5052 </span>
<span class="lnr"> 5053 </span>                   <span class="Statement">if</span> ( type === <span class="Constant">&quot;first&quot;</span> ) {
<span class="lnr"> 5054 </span>                      <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 5055 </span>                   }
<span class="lnr"> 5056 </span>
<span class="lnr"> 5057 </span>                   node = elem;
<span class="lnr"> 5058 </span>
<span class="lnr"> 5059 </span>                   <span class="Comment">/* falls through */</span>
<span class="lnr"> 5060 </span>                <span class="Statement">case</span> <span class="Constant">&quot;last&quot;</span>:
<span class="lnr"> 5061 </span>                   <span class="Statement">while</span> ( (node = node.nextSibling) ) {
<span class="lnr"> 5062 </span>                      <span class="Statement">if</span> ( node.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 5063 </span>                         <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 5064 </span>                      }
<span class="lnr"> 5065 </span>                   }
<span class="lnr"> 5066 </span>
<span class="lnr"> 5067 </span>                   <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 5068 </span>             }
<span class="lnr"> 5069 </span>          };
<span class="lnr"> 5070 </span>       },
<span class="lnr"> 5071 </span>
<span class="lnr"> 5072 </span>       <span class="Constant">&quot;PSEUDO&quot;</span>: <span class="Identifier">function</span>( pseudo, argument, context, xml ) {
<span class="lnr"> 5073 </span><span class="Comment">          // pseudo-class names are case-insensitive</span>
<span class="lnr"> 5074 </span><span class="Comment">          // <a href="http://www.w3.org/TR/selectors/#pseudo-classes">http://www.w3.org/TR/selectors/#pseudo-classes</a></span>
<span class="lnr"> 5075 </span><span class="Comment">          // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters</span>
<span class="lnr"> 5076 </span>          <span class="Type">var</span> args,
<span class="lnr"> 5077 </span>             fn = Expr.pseudos[ pseudo ] || Expr.pseudos[ pseudo.toLowerCase() ];
<span class="lnr"> 5078 </span>
<span class="lnr"> 5079 </span>          <span class="Statement">if</span> ( !fn ) {
<span class="lnr"> 5080 </span>             Sizzle.error( <span class="Constant">&quot;unsupported pseudo: &quot;</span> + pseudo );
<span class="lnr"> 5081 </span>          }
<span class="lnr"> 5082 </span>
<span class="lnr"> 5083 </span><span class="Comment">          // The user may use createPseudo to indicate that</span>
<span class="lnr"> 5084 </span><span class="Comment">          // arguments are needed to create the filter function</span>
<span class="lnr"> 5085 </span><span class="Comment">          // just as Sizzle does</span>
<span class="lnr"> 5086 </span>          <span class="Statement">if</span> ( !fn[ expando ] ) {
<span class="lnr"> 5087 </span>             <span class="Statement">if</span> ( fn.length &gt; <span class="Constant">1</span> ) {
<span class="lnr"> 5088 </span>                args = [ pseudo, pseudo, <span class="Constant">&quot;&quot;</span>, argument ];
<span class="lnr"> 5089 </span>                <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5090 </span>                   <span class="Statement">return</span> fn( elem, <span class="Constant">0</span>, args );
<span class="lnr"> 5091 </span>                };
<span class="lnr"> 5092 </span>             }
<span class="lnr"> 5093 </span>             <span class="Statement">return</span> fn;
<span class="lnr"> 5094 </span>          }
<span class="lnr"> 5095 </span>
<span class="lnr"> 5096 </span>          <span class="Statement">return</span> fn( argument, context, xml );
<span class="lnr"> 5097 </span>       }
<span class="lnr"> 5098 </span>    },
<span class="lnr"> 5099 </span>
<span class="lnr"> 5100 </span>    <span class="Statement">pseudos</span>: {
<span class="lnr"> 5101 </span>       <span class="Constant">&quot;not&quot;</span>: markFunction(<span class="Identifier">function</span>( selector, context, xml ) {
<span class="lnr"> 5102 </span><span class="Comment">          // Trim the selector passed to compile</span>
<span class="lnr"> 5103 </span><span class="Comment">          // to avoid treating leading and trailing</span>
<span class="lnr"> 5104 </span><span class="Comment">          // spaces as combinators</span>
<span class="lnr"> 5105 </span>          <span class="Type">var</span> matcher = compile( selector.replace( rtrim, <span class="Constant">&quot;$1&quot;</span> ), context, xml );
<span class="lnr"> 5106 </span>          <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5107 </span>             <span class="Statement">return</span> !matcher( elem );
<span class="lnr"> 5108 </span>          };
<span class="lnr"> 5109 </span>       }),
<span class="lnr"> 5110 </span>
<span class="lnr"> 5111 </span>       <span class="Constant">&quot;enabled&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5112 </span>          <span class="Statement">return</span> elem.disabled === <span class="Constant">false</span>;
<span class="lnr"> 5113 </span>       },
<span class="lnr"> 5114 </span>
<span class="lnr"> 5115 </span>       <span class="Constant">&quot;disabled&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5116 </span>          <span class="Statement">return</span> elem.disabled === <span class="Constant">true</span>;
<span class="lnr"> 5117 </span>       },
<span class="lnr"> 5118 </span>
<span class="lnr"> 5119 </span>       <span class="Constant">&quot;checked&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5120 </span><span class="Comment">          // In CSS3, :checked should return both checked and selected elements</span>
<span class="lnr"> 5121 </span><span class="Comment">          // <a href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked">http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked</a></span>
<span class="lnr"> 5122 </span>          <span class="Type">var</span> nodeName = elem.nodeName.toLowerCase();
<span class="lnr"> 5123 </span>          <span class="Statement">return</span> (nodeName === <span class="Constant">&quot;input&quot;</span> &amp;&amp; !!elem.checked) || (nodeName === <span class="Constant">&quot;option&quot;</span> &amp;&amp; !!elem.selected);
<span class="lnr"> 5124 </span>       },
<span class="lnr"> 5125 </span>
<span class="lnr"> 5126 </span>       <span class="Constant">&quot;selected&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5127 </span><span class="Comment">          // Accessing this property makes selected-by-default</span>
<span class="lnr"> 5128 </span><span class="Comment">          // options in Safari work properly</span>
<span class="lnr"> 5129 </span>          <span class="Statement">if</span> ( elem.parentNode ) {
<span class="lnr"> 5130 </span>             elem.parentNode.selectedIndex;
<span class="lnr"> 5131 </span>          }
<span class="lnr"> 5132 </span>
<span class="lnr"> 5133 </span>          <span class="Statement">return</span> elem.selected === <span class="Constant">true</span>;
<span class="lnr"> 5134 </span>       },
<span class="lnr"> 5135 </span>
<span class="lnr"> 5136 </span>       <span class="Constant">&quot;parent&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5137 </span>          <span class="Statement">return</span> !Expr.pseudos[<span class="Constant">&quot;empty&quot;</span>]( elem );
<span class="lnr"> 5138 </span>       },
<span class="lnr"> 5139 </span>
<span class="lnr"> 5140 </span>       <span class="Constant">&quot;empty&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5141 </span><span class="Comment">          // <a href="http://www.w3.org/TR/selectors/#empty-pseudo">http://www.w3.org/TR/selectors/#empty-pseudo</a></span>
<span class="lnr"> 5142 </span><span class="Comment">          // :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),</span>
<span class="lnr"> 5143 </span><span class="Comment">          //   not comment, processing instructions, or others</span>
<span class="lnr"> 5144 </span><span class="Comment">          // Thanks to Diego Perini for the nodeName shortcut</span>
<span class="lnr"> 5145 </span><span class="Comment">          //   Greater than &quot;@&quot; means alpha characters (specifically not starting with &quot;#&quot; or &quot;?&quot;)</span>
<span class="lnr"> 5146 </span>          <span class="Type">var</span> nodeType;
<span class="lnr"> 5147 </span>          elem = elem.firstChild;
<span class="lnr"> 5148 </span>          <span class="Statement">while</span> ( elem ) {
<span class="lnr"> 5149 </span>             <span class="Statement">if</span> ( elem.nodeName &gt; <span class="Constant">&quot;@&quot;</span> || (nodeType = elem.nodeType) === <span class="Constant">3</span> || nodeType === <span class="Constant">4</span> ) {
<span class="lnr"> 5150 </span>                <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 5151 </span>             }
<span class="lnr"> 5152 </span>             elem = elem.nextSibling;
<span class="lnr"> 5153 </span>          }
<span class="lnr"> 5154 </span>          <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 5155 </span>       },
<span class="lnr"> 5156 </span>
<span class="lnr"> 5157 </span>       <span class="Constant">&quot;contains&quot;</span>: markFunction(<span class="Identifier">function</span>( text ) {
<span class="lnr"> 5158 </span>          <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5159 </span>             <span class="Statement">return</span> ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) &gt; -<span class="Constant">1</span>;
<span class="lnr"> 5160 </span>          };
<span class="lnr"> 5161 </span>       }),
<span class="lnr"> 5162 </span>
<span class="lnr"> 5163 </span>       <span class="Constant">&quot;has&quot;</span>: markFunction(<span class="Identifier">function</span>( selector ) {
<span class="lnr"> 5164 </span>          <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5165 </span>             <span class="Statement">return</span> Sizzle( selector, elem ).length &gt; <span class="Constant">0</span>;
<span class="lnr"> 5166 </span>          };
<span class="lnr"> 5167 </span>       }),
<span class="lnr"> 5168 </span>
<span class="lnr"> 5169 </span>       <span class="Constant">&quot;header&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5170 </span>          <span class="Statement">return</span> rheader.test( elem.nodeName );
<span class="lnr"> 5171 </span>       },
<span class="lnr"> 5172 </span>
<span class="lnr"> 5173 </span>       <span class="Constant">&quot;text&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5174 </span>          <span class="Type">var</span> type, attr;
<span class="lnr"> 5175 </span><span class="Comment">          // IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)</span>
<span class="lnr"> 5176 </span><span class="Comment">          // use getAttribute instead to test this case</span>
<span class="lnr"> 5177 </span>          <span class="Statement">return</span> elem.nodeName.toLowerCase() === <span class="Constant">&quot;input&quot;</span> &amp;&amp;
<span class="lnr"> 5178 </span>             (type = elem.type) === <span class="Constant">&quot;text&quot;</span> &amp;&amp;
<span class="lnr"> 5179 </span>             ( (attr = elem.getAttribute(<span class="Constant">&quot;type&quot;</span>)) == <span class="Type">null</span> || attr.toLowerCase() === type );
<span class="lnr"> 5180 </span>       },
<span class="lnr"> 5181 </span>
<span class="lnr"> 5182 </span><span class="Comment">       // Input types</span>
<span class="lnr"> 5183 </span>       <span class="Constant">&quot;radio&quot;</span>: createInputPseudo(<span class="Constant">&quot;radio&quot;</span>),
<span class="lnr"> 5184 </span>       <span class="Constant">&quot;checkbox&quot;</span>: createInputPseudo(<span class="Constant">&quot;checkbox&quot;</span>),
<span class="lnr"> 5185 </span>       <span class="Constant">&quot;file&quot;</span>: createInputPseudo(<span class="Constant">&quot;file&quot;</span>),
<span class="lnr"> 5186 </span>       <span class="Constant">&quot;password&quot;</span>: createInputPseudo(<span class="Constant">&quot;password&quot;</span>),
<span class="lnr"> 5187 </span>       <span class="Constant">&quot;image&quot;</span>: createInputPseudo(<span class="Constant">&quot;image&quot;</span>),
<span class="lnr"> 5188 </span>
<span class="lnr"> 5189 </span>       <span class="Constant">&quot;submit&quot;</span>: createButtonPseudo(<span class="Constant">&quot;submit&quot;</span>),
<span class="lnr"> 5190 </span>       <span class="Constant">&quot;reset&quot;</span>: createButtonPseudo(<span class="Constant">&quot;reset&quot;</span>),
<span class="lnr"> 5191 </span>
<span class="lnr"> 5192 </span>       <span class="Constant">&quot;button&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5193 </span>          <span class="Type">var</span> name = elem.nodeName.toLowerCase();
<span class="lnr"> 5194 </span>          <span class="Statement">return</span> name === <span class="Constant">&quot;input&quot;</span> &amp;&amp; elem.type === <span class="Constant">&quot;button&quot;</span> || name === <span class="Constant">&quot;button&quot;</span>;
<span class="lnr"> 5195 </span>       },
<span class="lnr"> 5196 </span>
<span class="lnr"> 5197 </span>       <span class="Constant">&quot;input&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5198 </span>          <span class="Statement">return</span> rinputs.test( elem.nodeName );
<span class="lnr"> 5199 </span>       },
<span class="lnr"> 5200 </span>
<span class="lnr"> 5201 </span>       <span class="Constant">&quot;focus&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5202 </span>          <span class="Type">var</span> doc = elem.ownerDocument;
<span class="lnr"> 5203 </span>          <span class="Statement">return</span> elem === doc.activeElement &amp;&amp; (!doc.hasFocus || doc.hasFocus()) &amp;&amp; !!(elem.type || elem.href);
<span class="lnr"> 5204 </span>       },
<span class="lnr"> 5205 </span>
<span class="lnr"> 5206 </span>       <span class="Constant">&quot;active&quot;</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5207 </span>          <span class="Statement">return</span> elem === elem.ownerDocument.activeElement;
<span class="lnr"> 5208 </span>       }
<span class="lnr"> 5209 </span>    },
<span class="lnr"> 5210 </span>
<span class="lnr"> 5211 </span><span class="Comment">    // 过滤器</span>
<span class="lnr"> 5212 </span>    <span class="Statement">setFilters</span>: {
<span class="lnr"> 5213 </span>       <span class="Constant">&quot;first&quot;</span>: <span class="Identifier">function</span>( elements, argument, not ) {
<span class="lnr"> 5214 </span>          <span class="Statement">return</span> not ? elements.slice( <span class="Constant">1</span> ) : [ elements[<span class="Constant">0</span>] ];
<span class="lnr"> 5215 </span>       },
<span class="lnr"> 5216 </span>
<span class="lnr"> 5217 </span>       <span class="Constant">&quot;last&quot;</span>: <span class="Identifier">function</span>( elements, argument, not ) {
<span class="lnr"> 5218 </span>          <span class="Type">var</span> elem = elements.pop();
<span class="lnr"> 5219 </span>          <span class="Statement">return</span> not ? elements : [ elem ];
<span class="lnr"> 5220 </span>       },
<span class="lnr"> 5221 </span>
<span class="lnr"> 5222 </span>       <span class="Constant">&quot;even&quot;</span>: <span class="Identifier">function</span>( elements, argument, not ) {
<span class="lnr"> 5223 </span>          <span class="Type">var</span> results = [],
<span class="lnr"> 5224 </span>             i = not ? <span class="Constant">1</span> : <span class="Constant">0</span>,
<span class="lnr"> 5225 </span>             len = elements.length;
<span class="lnr"> 5226 </span>          <span class="Statement">for</span> ( ; i &lt; len; i = i + <span class="Constant">2</span> ) {
<span class="lnr"> 5227 </span>             results.push( elements[i] );
<span class="lnr"> 5228 </span>          }
<span class="lnr"> 5229 </span>          <span class="Statement">return</span> results;
<span class="lnr"> 5230 </span>       },
<span class="lnr"> 5231 </span>
<span class="lnr"> 5232 </span>       <span class="Constant">&quot;odd&quot;</span>: <span class="Identifier">function</span>( elements, argument, not ) {
<span class="lnr"> 5233 </span>          <span class="Type">var</span> results = [],
<span class="lnr"> 5234 </span>             i = not ? <span class="Constant">0</span> : <span class="Constant">1</span>,
<span class="lnr"> 5235 </span>             len = elements.length;
<span class="lnr"> 5236 </span>          <span class="Statement">for</span> ( ; i &lt; len; i = i + <span class="Constant">2</span> ) {
<span class="lnr"> 5237 </span>             results.push( elements[i] );
<span class="lnr"> 5238 </span>          }
<span class="lnr"> 5239 </span>          <span class="Statement">return</span> results;
<span class="lnr"> 5240 </span>       },
<span class="lnr"> 5241 </span>
<span class="lnr"> 5242 </span>       <span class="Constant">&quot;lt&quot;</span>: <span class="Identifier">function</span>( elements, argument, not ) {
<span class="lnr"> 5243 </span>          <span class="Statement">return</span> not ? elements.slice( +argument ) : elements.slice( <span class="Constant">0</span>, +argument );
<span class="lnr"> 5244 </span>       },
<span class="lnr"> 5245 </span>
<span class="lnr"> 5246 </span>       <span class="Constant">&quot;gt&quot;</span>: <span class="Identifier">function</span>( elements, argument, not ) {
<span class="lnr"> 5247 </span>          <span class="Statement">return</span> not ? elements.slice( <span class="Constant">0</span>, +argument + <span class="Constant">1</span> ) : elements.slice( +argument + <span class="Constant">1</span> );
<span class="lnr"> 5248 </span>       },
<span class="lnr"> 5249 </span>
<span class="lnr"> 5250 </span>       <span class="Constant">&quot;eq&quot;</span>: <span class="Identifier">function</span>( elements, argument, not ) {
<span class="lnr"> 5251 </span>          <span class="Type">var</span> elem = elements.splice( +argument, <span class="Constant">1</span> );
<span class="lnr"> 5252 </span>          <span class="Statement">return</span> not ? elements : elem;
<span class="lnr"> 5253 </span>       }
<span class="lnr"> 5254 </span>    }
<span class="lnr"> 5255 </span>};
<span class="lnr"> 5256 </span>
<span class="lnr"> 5257 </span><span class="Identifier">function</span> siblingCheck( a, b, ret ) {
<span class="lnr"> 5258 </span>    <span class="Statement">if</span> ( a === b ) {
<span class="lnr"> 5259 </span>       <span class="Statement">return</span> ret;
<span class="lnr"> 5260 </span>    }
<span class="lnr"> 5261 </span>
<span class="lnr"> 5262 </span>    <span class="Type">var</span> cur = a.nextSibling;
<span class="lnr"> 5263 </span>
<span class="lnr"> 5264 </span>    <span class="Statement">while</span> ( cur ) {
<span class="lnr"> 5265 </span>       <span class="Statement">if</span> ( cur === b ) {
<span class="lnr"> 5266 </span>          <span class="Statement">return</span> -<span class="Constant">1</span>;
<span class="lnr"> 5267 </span>       }
<span class="lnr"> 5268 </span>
<span class="lnr"> 5269 </span>       cur = cur.nextSibling;
<span class="lnr"> 5270 </span>    }
<span class="lnr"> 5271 </span>
<span class="lnr"> 5272 </span>    <span class="Statement">return</span> <span class="Constant">1</span>;
<span class="lnr"> 5273 </span>}
<span class="lnr"> 5274 </span>
<span class="lnr"> 5275 </span>sortOrder = docElem.compareDocumentPosition ?
<span class="lnr"> 5276 </span>    <span class="Identifier">function</span>( a, b ) {
<span class="lnr"> 5277 </span>       <span class="Statement">if</span> ( a === b ) {
<span class="lnr"> 5278 </span>          hasDuplicate = <span class="Constant">true</span>;
<span class="lnr"> 5279 </span>          <span class="Statement">return</span> <span class="Constant">0</span>;
<span class="lnr"> 5280 </span>       }
<span class="lnr"> 5281 </span>
<span class="lnr"> 5282 </span>       <span class="Statement">return</span> ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
<span class="lnr"> 5283 </span>          a.<span class="Statement">compareDocumentPosition</span> :
<span class="lnr"> 5284 </span>          a.compareDocumentPosition(b) &amp; <span class="Constant">4</span>
<span class="lnr"> 5285 </span>       ) ? -<span class="Statement">1</span> : <span class="Constant">1</span>;
<span class="lnr"> 5286 </span>    } :
<span class="lnr"> 5287 </span>    <span class="Identifier">function</span>( a, b ) {
<span class="lnr"> 5288 </span><span class="Comment">       // The nodes are identical, we can exit early</span>
<span class="lnr"> 5289 </span>       <span class="Statement">if</span> ( a === b ) {
<span class="lnr"> 5290 </span>          hasDuplicate = <span class="Constant">true</span>;
<span class="lnr"> 5291 </span>          <span class="Statement">return</span> <span class="Constant">0</span>;
<span class="lnr"> 5292 </span>
<span class="lnr"> 5293 </span><span class="Comment">       // Fallback to using sourceIndex (in IE) if it's available on both nodes</span>
<span class="lnr"> 5294 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( a.sourceIndex &amp;&amp; b.sourceIndex ) {
<span class="lnr"> 5295 </span>          <span class="Statement">return</span> a.sourceIndex - b.sourceIndex;
<span class="lnr"> 5296 </span>       }
<span class="lnr"> 5297 </span>
<span class="lnr"> 5298 </span>       <span class="Type">var</span> al, bl,
<span class="lnr"> 5299 </span>          ap = [],
<span class="lnr"> 5300 </span>          bp = [],
<span class="lnr"> 5301 </span>          aup = a.parentNode,
<span class="lnr"> 5302 </span>          bup = b.parentNode,
<span class="lnr"> 5303 </span>          cur = aup;
<span class="lnr"> 5304 </span>
<span class="lnr"> 5305 </span><span class="Comment">       // If the nodes are siblings (or identical) we can do a quick check</span>
<span class="lnr"> 5306 </span>       <span class="Statement">if</span> ( aup === bup ) {
<span class="lnr"> 5307 </span>          <span class="Statement">return</span> siblingCheck( a, b );
<span class="lnr"> 5308 </span>
<span class="lnr"> 5309 </span><span class="Comment">       // If no parents were found then the nodes are disconnected</span>
<span class="lnr"> 5310 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( !aup ) {
<span class="lnr"> 5311 </span>          <span class="Statement">return</span> -<span class="Constant">1</span>;
<span class="lnr"> 5312 </span>
<span class="lnr"> 5313 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( !bup ) {
<span class="lnr"> 5314 </span>          <span class="Statement">return</span> <span class="Constant">1</span>;
<span class="lnr"> 5315 </span>       }
<span class="lnr"> 5316 </span>
<span class="lnr"> 5317 </span><span class="Comment">       // Otherwise they're somewhere else in the tree so we need</span>
<span class="lnr"> 5318 </span><span class="Comment">       // to build up a full list of the parentNodes for comparison</span>
<span class="lnr"> 5319 </span>       <span class="Statement">while</span> ( cur ) {
<span class="lnr"> 5320 </span>          ap.unshift( cur );
<span class="lnr"> 5321 </span>          cur = cur.parentNode;
<span class="lnr"> 5322 </span>       }
<span class="lnr"> 5323 </span>
<span class="lnr"> 5324 </span>       cur = bup;
<span class="lnr"> 5325 </span>
<span class="lnr"> 5326 </span>       <span class="Statement">while</span> ( cur ) {
<span class="lnr"> 5327 </span>          bp.unshift( cur );
<span class="lnr"> 5328 </span>          cur = cur.parentNode;
<span class="lnr"> 5329 </span>       }
<span class="lnr"> 5330 </span>
<span class="lnr"> 5331 </span>       al = ap.length;
<span class="lnr"> 5332 </span>       bl = bp.length;
<span class="lnr"> 5333 </span>
<span class="lnr"> 5334 </span><span class="Comment">       // Start walking down the tree looking for a discrepancy</span>
<span class="lnr"> 5335 </span>       <span class="Statement">for</span> ( <span class="Type">var</span> i = <span class="Constant">0</span>; i &lt; al &amp;&amp; i &lt; bl; i++ ) {
<span class="lnr"> 5336 </span>          <span class="Statement">if</span> ( ap[i] !== bp[i] ) {
<span class="lnr"> 5337 </span>             <span class="Statement">return</span> siblingCheck( ap[i], bp[i] );
<span class="lnr"> 5338 </span>          }
<span class="lnr"> 5339 </span>       }
<span class="lnr"> 5340 </span>
<span class="lnr"> 5341 </span><span class="Comment">       // We ended someplace up the tree so do a sibling check</span>
<span class="lnr"> 5342 </span>       <span class="Statement">return</span> i === al ?
<span class="lnr"> 5343 </span>          siblingCheck( a, bp[i], -<span class="Constant">1</span> ) :
<span class="lnr"> 5344 </span>          siblingCheck( ap[i], b, <span class="Constant">1</span> );
<span class="lnr"> 5345 </span>    };
<span class="lnr"> 5346 </span>
<span class="lnr"> 5347 </span><span class="Comment">// Always assume the presence of duplicates if sort doesn't</span>
<span class="lnr"> 5348 </span><span class="Comment">// pass them to our comparison function (as in Google Chrome).</span>
<span class="lnr"> 5349 </span>[<span class="Constant">0</span>, <span class="Constant">0</span>].sort( sortOrder );
<span class="lnr"> 5350 </span>baseHasDuplicate = !hasDuplicate;
<span class="lnr"> 5351 </span>
<span class="lnr"> 5352 </span><span class="Comment">// Document sorting and removing duplicates</span>
<span class="lnr"> 5353 </span>Sizzle.uniqueSort = <span class="Identifier">function</span>( results ) {
<span class="lnr"> 5354 </span>    <span class="Type">var</span> elem,
<span class="lnr"> 5355 </span>       i = <span class="Constant">1</span>;
<span class="lnr"> 5356 </span>
<span class="lnr"> 5357 </span>    hasDuplicate = baseHasDuplicate;
<span class="lnr"> 5358 </span>    results.sort( sortOrder );
<span class="lnr"> 5359 </span>
<span class="lnr"> 5360 </span>    <span class="Statement">if</span> ( hasDuplicate ) {
<span class="lnr"> 5361 </span>       <span class="Statement">for</span> ( ; (elem = results[i]); i++ ) {
<span class="lnr"> 5362 </span>          <span class="Statement">if</span> ( elem === results[ i - <span class="Constant">1</span> ] ) {
<span class="lnr"> 5363 </span>             results.splice( i--, <span class="Constant">1</span> );
<span class="lnr"> 5364 </span>          }
<span class="lnr"> 5365 </span>       }
<span class="lnr"> 5366 </span>    }
<span class="lnr"> 5367 </span>
<span class="lnr"> 5368 </span>    <span class="Statement">return</span> results;
<span class="lnr"> 5369 </span>};
<span class="lnr"> 5370 </span>
<span class="lnr"> 5371 </span>Sizzle.error = <span class="Identifier">function</span>( msg ) {
<span class="lnr"> 5372 </span>    <span class="Statement">throw</span> <span class="Statement">new</span> <span class="Special">Error</span>( <span class="Constant">&quot;Syntax error, unrecognized expression: &quot;</span> + msg );
<span class="lnr"> 5373 </span>};
<span class="lnr"> 5374 </span>
<span class="lnr"> 5375 </span><span class="Identifier">function</span> tokenize( selector, context, xml, parseOnly ) {
<span class="lnr"> 5376 </span>    <span class="Type">var</span> matched, match, tokens, type,
<span class="lnr"> 5377 </span>       soFar, groups, group, i,
<span class="lnr"> 5378 </span>       preFilters, filters,
<span class="lnr"> 5379 </span>       checkContext = !xml &amp;&amp; context !== document,
<span class="lnr"> 5380 </span><span class="Comment">       // Token cache should maintain spaces</span>
<span class="lnr"> 5381 </span>       key = ( checkContext ? <span class="Constant">&quot;&lt;s&gt;&quot;</span> : <span class="Constant">&quot;&quot;</span> ) + selector.replace( rtrim, <span class="Constant">&quot;$1&lt;s&gt;&quot;</span> ),
<span class="lnr"> 5382 </span>       cached = tokenCache[ expando ][ key ];
<span class="lnr"> 5383 </span>
<span class="lnr"> 5384 </span>    <span class="Statement">if</span> ( cached ) {
<span class="lnr"> 5385 </span>       <span class="Statement">return</span> parseOnly ? <span class="Constant">0</span> : slice.call( cached, <span class="Constant">0</span> );
<span class="lnr"> 5386 </span>    }
<span class="lnr"> 5387 </span>
<span class="lnr"> 5388 </span>    soFar = selector;
<span class="lnr"> 5389 </span>    groups = [];
<span class="lnr"> 5390 </span>    i = <span class="Constant">0</span>;
<span class="lnr"> 5391 </span>    preFilters = Expr.preFilter;
<span class="lnr"> 5392 </span>    filters = Expr.filter;
<span class="lnr"> 5393 </span>
<span class="lnr"> 5394 </span>    <span class="Statement">while</span> ( soFar ) {
<span class="lnr"> 5395 </span>
<span class="lnr"> 5396 </span><span class="Comment">       // Comma and first run</span>
<span class="lnr"> 5397 </span>       <span class="Statement">if</span> ( !matched || (match = rcomma.exec( soFar )) ) {
<span class="lnr"> 5398 </span>          <span class="Statement">if</span> ( match ) {
<span class="lnr"> 5399 </span>             soFar = soFar.slice( match[<span class="Constant">0</span>].length );
<span class="lnr"> 5400 </span>             tokens.selector = group;
<span class="lnr"> 5401 </span>          }
<span class="lnr"> 5402 </span>          groups.push( tokens = [] );
<span class="lnr"> 5403 </span>          group = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 5404 </span>
<span class="lnr"> 5405 </span><span class="Comment">          // Need to make sure we're within a narrower context if necessary</span>
<span class="lnr"> 5406 </span><span class="Comment">          // Adding a descendant combinator will generate what is needed</span>
<span class="lnr"> 5407 </span>          <span class="Statement">if</span> ( checkContext ) {
<span class="lnr"> 5408 </span>             soFar = <span class="Constant">&quot; &quot;</span> + soFar;
<span class="lnr"> 5409 </span>          }
<span class="lnr"> 5410 </span>       }
<span class="lnr"> 5411 </span>
<span class="lnr"> 5412 </span>       matched = <span class="Constant">false</span>;
<span class="lnr"> 5413 </span>
<span class="lnr"> 5414 </span><span class="Comment">       // Combinators</span>
<span class="lnr"> 5415 </span>       <span class="Statement">if</span> ( (match = rcombinators.exec( soFar )) ) {
<span class="lnr"> 5416 </span>          group += match[<span class="Constant">0</span>];
<span class="lnr"> 5417 </span>          soFar = soFar.slice( match[<span class="Constant">0</span>].length );
<span class="lnr"> 5418 </span>
<span class="lnr"> 5419 </span><span class="Comment">          // Cast descendant combinators to space</span>
<span class="lnr"> 5420 </span>          matched = tokens.push({
<span class="lnr"> 5421 </span>             <span class="Statement">part</span>: match.pop().replace( rtrim, <span class="Constant">&quot; &quot;</span> ),
<span class="lnr"> 5422 </span>             <span class="Statement">string</span>: match[<span class="Constant">0</span>],
<span class="lnr"> 5423 </span>             <span class="Statement">captures</span>: match
<span class="lnr"> 5424 </span>          });
<span class="lnr"> 5425 </span>       }
<span class="lnr"> 5426 </span>
<span class="lnr"> 5427 </span><span class="Comment">       // Filters</span>
<span class="lnr"> 5428 </span>       <span class="Statement">for</span> ( type <span class="Statement">in</span> filters ) {
<span class="lnr"> 5429 </span>          <span class="Statement">if</span> ( (match = matchExpr[ type ].exec( soFar )) &amp;&amp; (!preFilters[ type ] ||
<span class="lnr"> 5430 </span>             ( match = preFilters[ type ](match, context, xml) )) ) {
<span class="lnr"> 5431 </span>
<span class="lnr"> 5432 </span>             group += match[<span class="Constant">0</span>];
<span class="lnr"> 5433 </span>             soFar = soFar.slice( match[<span class="Constant">0</span>].length );
<span class="lnr"> 5434 </span>             matched = tokens.push({
<span class="lnr"> 5435 </span>                <span class="Statement">part</span>: type,
<span class="lnr"> 5436 </span>                <span class="Statement">string</span>: match.shift(),
<span class="lnr"> 5437 </span>                <span class="Statement">captures</span>: match
<span class="lnr"> 5438 </span>             });
<span class="lnr"> 5439 </span>          }
<span class="lnr"> 5440 </span>       }
<span class="lnr"> 5441 </span>
<span class="lnr"> 5442 </span>       <span class="Statement">if</span> ( !matched ) {
<span class="lnr"> 5443 </span>          <span class="Statement">break</span>;
<span class="lnr"> 5444 </span>       }
<span class="lnr"> 5445 </span>    }
<span class="lnr"> 5446 </span>
<span class="lnr"> 5447 </span><span class="Comment">    // Attach the full group as a selector</span>
<span class="lnr"> 5448 </span>    <span class="Statement">if</span> ( group ) {
<span class="lnr"> 5449 </span>       tokens.selector = group;
<span class="lnr"> 5450 </span>    }
<span class="lnr"> 5451 </span>
<span class="lnr"> 5452 </span><span class="Comment">    // Return the length of the invalid excess</span>
<span class="lnr"> 5453 </span><span class="Comment">    // if we're just parsing</span>
<span class="lnr"> 5454 </span><span class="Comment">    // Otherwise, throw an error or return tokens</span>
<span class="lnr"> 5455 </span>    <span class="Statement">return</span> parseOnly ?
<span class="lnr"> 5456 </span>       soFar.<span class="Statement">length</span> :
<span class="lnr"> 5457 </span>       soFar ?
<span class="lnr"> 5458 </span>          Sizzle.error( selector ) :
<span class="lnr"> 5459 </span><span class="Comment">          // Cache the tokens</span>
<span class="lnr"> 5460 </span>          slice.call( tokenCache(key, groups), <span class="Constant">0</span> );
<span class="lnr"> 5461 </span>}
<span class="lnr"> 5462 </span>
<span class="lnr"> 5463 </span><span class="Identifier">function</span> addCombinator( matcher, combinator, context, xml ) {
<span class="lnr"> 5464 </span>    <span class="Type">var</span> dir = combinator.dir,
<span class="lnr"> 5465 </span>       doneName = done++;
<span class="lnr"> 5466 </span>
<span class="lnr"> 5467 </span>    <span class="Statement">if</span> ( !matcher ) {
<span class="lnr"> 5468 </span><span class="Comment">       // If there is no matcher to check, check against the context</span>
<span class="lnr"> 5469 </span>       matcher = <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5470 </span>          <span class="Statement">return</span> elem === context;
<span class="lnr"> 5471 </span>       };
<span class="lnr"> 5472 </span>    }
<span class="lnr"> 5473 </span>    <span class="Statement">return</span> combinator.first ?
<span class="lnr"> 5474 </span>       <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5475 </span>          <span class="Statement">while</span> ( (elem = elem[ dir ]) ) {
<span class="lnr"> 5476 </span>             <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 5477 </span>                <span class="Statement">return</span> matcher( elem ) &amp;&amp; elem;
<span class="lnr"> 5478 </span>             }
<span class="lnr"> 5479 </span>          }
<span class="lnr"> 5480 </span>       } :
<span class="lnr"> 5481 </span>       xml ?
<span class="lnr"> 5482 </span>          <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5483 </span>             <span class="Statement">while</span> ( (elem = elem[ dir ]) ) {
<span class="lnr"> 5484 </span>                <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 5485 </span>                   <span class="Statement">if</span> ( matcher( elem ) ) {
<span class="lnr"> 5486 </span>                      <span class="Statement">return</span> elem;
<span class="lnr"> 5487 </span>                   }
<span class="lnr"> 5488 </span>                }
<span class="lnr"> 5489 </span>             }
<span class="lnr"> 5490 </span>          } :
<span class="lnr"> 5491 </span>          <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5492 </span>             <span class="Type">var</span> cache,
<span class="lnr"> 5493 </span>                dirkey = doneName + <span class="Constant">&quot;.&quot;</span> + dirruns,
<span class="lnr"> 5494 </span>                cachedkey = dirkey + <span class="Constant">&quot;.&quot;</span> + cachedruns;
<span class="lnr"> 5495 </span>             <span class="Statement">while</span> ( (elem = elem[ dir ]) ) {
<span class="lnr"> 5496 </span>                <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 5497 </span>                   <span class="Statement">if</span> ( (cache = elem[ expando ]) === cachedkey ) {
<span class="lnr"> 5498 </span>                      <span class="Statement">return</span> elem.sizset;
<span class="lnr"> 5499 </span>                   } <span class="Statement">else</span> <span class="Statement">if</span> ( <span class="Statement">typeof</span> cache === <span class="Constant">&quot;string&quot;</span> &amp;&amp; cache.indexOf(dirkey) === <span class="Constant">0</span> ) {
<span class="lnr"> 5500 </span>                      <span class="Statement">if</span> ( elem.sizset ) {
<span class="lnr"> 5501 </span>                         <span class="Statement">return</span> elem;
<span class="lnr"> 5502 </span>                      }
<span class="lnr"> 5503 </span>                   } <span class="Statement">else</span> {
<span class="lnr"> 5504 </span>                      elem[ expando ] = cachedkey;
<span class="lnr"> 5505 </span>                      <span class="Statement">if</span> ( matcher( elem ) ) {
<span class="lnr"> 5506 </span>                         elem.sizset = <span class="Constant">true</span>;
<span class="lnr"> 5507 </span>                         <span class="Statement">return</span> elem;
<span class="lnr"> 5508 </span>                      }
<span class="lnr"> 5509 </span>                      elem.sizset = <span class="Constant">false</span>;
<span class="lnr"> 5510 </span>                   }
<span class="lnr"> 5511 </span>                }
<span class="lnr"> 5512 </span>             }
<span class="lnr"> 5513 </span>          };
<span class="lnr"> 5514 </span>}
<span class="lnr"> 5515 </span>
<span class="lnr"> 5516 </span><span class="Identifier">function</span> addMatcher( higher, deeper ) {
<span class="lnr"> 5517 </span>    <span class="Statement">return</span> higher ?
<span class="lnr"> 5518 </span>       <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5519 </span>          <span class="Type">var</span> result = deeper( elem );
<span class="lnr"> 5520 </span>          <span class="Statement">return</span> result &amp;&amp; higher( result === <span class="Constant">true</span> ? elem : result );
<span class="lnr"> 5521 </span>       } :
<span class="lnr"> 5522 </span>       deeper;
<span class="lnr"> 5523 </span>}
<span class="lnr"> 5524 </span>
<span class="lnr"> 5525 </span><span class="Comment">// [&quot;TAG&quot;, &quot;&gt;&quot;, &quot;ID&quot;, &quot; &quot;, &quot;CLASS&quot;]</span>
<span class="lnr"> 5526 </span><span class="Identifier">function</span> matcherFromTokens( tokens, context, xml ) {
<span class="lnr"> 5527 </span>    <span class="Type">var</span> token, matcher,
<span class="lnr"> 5528 </span>       i = <span class="Constant">0</span>;
<span class="lnr"> 5529 </span>
<span class="lnr"> 5530 </span>    <span class="Statement">for</span> ( ; (token = tokens[i]); i++ ) {
<span class="lnr"> 5531 </span>       <span class="Statement">if</span> ( Expr.relative[ token.part ] ) {
<span class="lnr"> 5532 </span>          matcher = addCombinator( matcher, Expr.relative[ token.part ], context, xml );
<span class="lnr"> 5533 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 5534 </span>          matcher = addMatcher( matcher, Expr.filter[ token.part ].apply(<span class="Type">null</span>, token.captures.concat( context, xml )) );
<span class="lnr"> 5535 </span>       }
<span class="lnr"> 5536 </span>    }
<span class="lnr"> 5537 </span>
<span class="lnr"> 5538 </span>    <span class="Statement">return</span> matcher;
<span class="lnr"> 5539 </span>}
<span class="lnr"> 5540 </span>
<span class="lnr"> 5541 </span><span class="Identifier">function</span> matcherFromGroupMatchers( matchers ) {
<span class="lnr"> 5542 </span>    <span class="Statement">return</span> <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 5543 </span>       <span class="Type">var</span> matcher,
<span class="lnr"> 5544 </span>          j = <span class="Constant">0</span>;
<span class="lnr"> 5545 </span>       <span class="Statement">for</span> ( ; (matcher = matchers[j]); j++ ) {
<span class="lnr"> 5546 </span>          <span class="Statement">if</span> ( matcher(elem) ) {
<span class="lnr"> 5547 </span>             <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 5548 </span>          }
<span class="lnr"> 5549 </span>       }
<span class="lnr"> 5550 </span>       <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 5551 </span>    };
<span class="lnr"> 5552 </span>}
<span class="lnr"> 5553 </span>
<span class="lnr"> 5554 </span>compile = Sizzle.compile = <span class="Identifier">function</span>( selector, context, xml ) {
<span class="lnr"> 5555 </span>    <span class="Type">var</span> group, i, len,
<span class="lnr"> 5556 </span>       cached = compilerCache[ expando ][ selector ];
<span class="lnr"> 5557 </span>
<span class="lnr"> 5558 </span><span class="Comment">    // Return a cached group function if already generated (context dependent)</span>
<span class="lnr"> 5559 </span>    <span class="Statement">if</span> ( cached &amp;&amp; cached.context === context ) {
<span class="lnr"> 5560 </span>       <span class="Statement">return</span> cached;
<span class="lnr"> 5561 </span>    }
<span class="lnr"> 5562 </span>
<span class="lnr"> 5563 </span><span class="Comment">    // Generate a function of recursive functions that can be used to check each element</span>
<span class="lnr"> 5564 </span>    group = tokenize( selector, context, xml );
<span class="lnr"> 5565 </span>    <span class="Statement">for</span> ( i = <span class="Constant">0</span>, len = group.length; i &lt; len; i++ ) {
<span class="lnr"> 5566 </span>       group[i] = matcherFromTokens(group[i], context, xml);
<span class="lnr"> 5567 </span>    }
<span class="lnr"> 5568 </span>
<span class="lnr"> 5569 </span><span class="Comment">    // Cache the compiled function</span>
<span class="lnr"> 5570 </span>    cached = compilerCache( selector, matcherFromGroupMatchers(group) );
<span class="lnr"> 5571 </span>    cached.context = context;
<span class="lnr"> 5572 </span>    cached.runs = cached.dirruns = <span class="Constant">0</span>;
<span class="lnr"> 5573 </span>    <span class="Statement">return</span> cached;
<span class="lnr"> 5574 </span>};
<span class="lnr"> 5575 </span>
<span class="lnr"> 5576 </span><span class="Identifier">function</span> multipleContexts( selector, contexts, results, seed ) {
<span class="lnr"> 5577 </span>    <span class="Type">var</span> i = <span class="Constant">0</span>,
<span class="lnr"> 5578 </span>       len = contexts.length;
<span class="lnr"> 5579 </span>    <span class="Statement">for</span> ( ; i &lt; len; i++ ) {
<span class="lnr"> 5580 </span>       Sizzle( selector, contexts[i], results, seed );
<span class="lnr"> 5581 </span>    }
<span class="lnr"> 5582 </span>}
<span class="lnr"> 5583 </span>
<span class="lnr"> 5584 </span><span class="Identifier">function</span> handlePOSGroup( selector, posfilter, argument, contexts, seed, not ) {
<span class="lnr"> 5585 </span>    <span class="Type">var</span> results,
<span class="lnr"> 5586 </span>       fn = Expr.setFilters[ posfilter.toLowerCase() ];
<span class="lnr"> 5587 </span>
<span class="lnr"> 5588 </span>    <span class="Statement">if</span> ( !fn ) {
<span class="lnr"> 5589 </span>       Sizzle.error( posfilter );
<span class="lnr"> 5590 </span>    }
<span class="lnr"> 5591 </span>
<span class="lnr"> 5592 </span>    <span class="Statement">if</span> ( selector || !(results = seed) ) {
<span class="lnr"> 5593 </span>       multipleContexts( selector || <span class="Constant">&quot;*&quot;</span>, contexts, (results = []), seed );
<span class="lnr"> 5594 </span>    }
<span class="lnr"> 5595 </span>
<span class="lnr"> 5596 </span>    <span class="Statement">return</span> results.length &gt; <span class="Constant">0</span> ? fn( results, argument, not ) : [];
<span class="lnr"> 5597 </span>}
<span class="lnr"> 5598 </span>
<span class="lnr"> 5599 </span><span class="Identifier">function</span> handlePOS( groups, context, results, seed ) {
<span class="lnr"> 5600 </span>    <span class="Type">var</span> group, part, j, groupLen, token, selector,
<span class="lnr"> 5601 </span>       anchor, elements, match, matched,
<span class="lnr"> 5602 </span>       lastIndex, currentContexts, not,
<span class="lnr"> 5603 </span>       i = <span class="Constant">0</span>,
<span class="lnr"> 5604 </span>       len = groups.length,
<span class="lnr"> 5605 </span>       rpos = matchExpr[<span class="Constant">&quot;POS&quot;</span>],
<span class="lnr"> 5606 </span><span class="Comment">       // This is generated here in case matchExpr[&quot;POS&quot;] is extended</span>
<span class="lnr"> 5607 </span>       rposgroups = <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^&quot;</span> + rpos.source + <span class="Constant">&quot;(?!&quot;</span> + whitespace + <span class="Constant">&quot;)&quot;</span>, <span class="Constant">&quot;i&quot;</span> ),
<span class="lnr"> 5608 </span><span class="Comment">       // This is for making sure non-participating</span>
<span class="lnr"> 5609 </span><span class="Comment">       // matching groups are represented cross-browser (IE6-8)</span>
<span class="lnr"> 5610 </span>       setUndefined = <span class="Identifier">function</span>() {
<span class="lnr"> 5611 </span>          <span class="Type">var</span> i = <span class="Constant">1</span>,
<span class="lnr"> 5612 </span>             len = arguments.length - <span class="Constant">2</span>;
<span class="lnr"> 5613 </span>          <span class="Statement">for</span> ( ; i &lt; len; i++ ) {
<span class="lnr"> 5614 </span>             <span class="Statement">if</span> ( arguments[i] === <span class="Type">undefined</span> ) {
<span class="lnr"> 5615 </span>                match[i] = <span class="Type">undefined</span>;
<span class="lnr"> 5616 </span>             }
<span class="lnr"> 5617 </span>          }
<span class="lnr"> 5618 </span>       };
<span class="lnr"> 5619 </span>
<span class="lnr"> 5620 </span>    <span class="Statement">for</span> ( ; i &lt; len; i++ ) {
<span class="lnr"> 5621 </span>       group = groups[i];
<span class="lnr"> 5622 </span>       part = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 5623 </span>       elements = seed;
<span class="lnr"> 5624 </span>       <span class="Statement">for</span> ( j = <span class="Constant">0</span>, groupLen = group.length; j &lt; groupLen; j++ ) {
<span class="lnr"> 5625 </span>          token = group[j];
<span class="lnr"> 5626 </span>          selector = token.string;
<span class="lnr"> 5627 </span>          <span class="Statement">if</span> ( token.part === <span class="Constant">&quot;PSEUDO&quot;</span> ) {
<span class="lnr"> 5628 </span><span class="Comment">             // Reset regex index to 0</span>
<span class="lnr"> 5629 </span>             rpos.exec(<span class="Constant">&quot;&quot;</span>);
<span class="lnr"> 5630 </span>             anchor = <span class="Constant">0</span>;
<span class="lnr"> 5631 </span>             <span class="Statement">while</span> ( (match = rpos.exec( selector )) ) {
<span class="lnr"> 5632 </span>                matched = <span class="Constant">true</span>;
<span class="lnr"> 5633 </span>                lastIndex = rpos.lastIndex = match.index + match[<span class="Constant">0</span>].length;
<span class="lnr"> 5634 </span>                <span class="Statement">if</span> ( lastIndex &gt; anchor ) {
<span class="lnr"> 5635 </span>                   part += selector.slice( anchor, match.index );
<span class="lnr"> 5636 </span>                   anchor = lastIndex;
<span class="lnr"> 5637 </span>                   currentContexts = [ context ];
<span class="lnr"> 5638 </span>
<span class="lnr"> 5639 </span>                   <span class="Statement">if</span> ( rcombinators.test(part) ) {
<span class="lnr"> 5640 </span>                      <span class="Statement">if</span> ( elements ) {
<span class="lnr"> 5641 </span>                         currentContexts = elements;
<span class="lnr"> 5642 </span>                      }
<span class="lnr"> 5643 </span>                      elements = seed;
<span class="lnr"> 5644 </span>                   }
<span class="lnr"> 5645 </span>
<span class="lnr"> 5646 </span>                   <span class="Statement">if</span> ( (not = rendsWithNot.test( part )) ) {
<span class="lnr"> 5647 </span>                      part = part.slice( <span class="Constant">0</span>, -<span class="Constant">5</span> ).replace( rcombinators, <span class="Constant">&quot;$&amp;*&quot;</span> );
<span class="lnr"> 5648 </span>                      anchor++;
<span class="lnr"> 5649 </span>                   }
<span class="lnr"> 5650 </span>
<span class="lnr"> 5651 </span>                   <span class="Statement">if</span> ( match.length &gt; <span class="Constant">1</span> ) {
<span class="lnr"> 5652 </span>                      match[<span class="Constant">0</span>].replace( rposgroups, setUndefined );
<span class="lnr"> 5653 </span>                   }
<span class="lnr"> 5654 </span>                   elements = handlePOSGroup( part, match[<span class="Constant">1</span>], match[<span class="Constant">2</span>], currentContexts, elements, not );
<span class="lnr"> 5655 </span>                }
<span class="lnr"> 5656 </span>                part = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 5657 </span>             }
<span class="lnr"> 5658 </span>
<span class="lnr"> 5659 </span>          }
<span class="lnr"> 5660 </span>
<span class="lnr"> 5661 </span>          <span class="Statement">if</span> ( !matched ) {
<span class="lnr"> 5662 </span>             part += selector;
<span class="lnr"> 5663 </span>          }
<span class="lnr"> 5664 </span>          matched = <span class="Constant">false</span>;
<span class="lnr"> 5665 </span>       }
<span class="lnr"> 5666 </span>
<span class="lnr"> 5667 </span>       <span class="Statement">if</span> ( part ) {
<span class="lnr"> 5668 </span>          <span class="Statement">if</span> ( rcombinators.test(part) ) {
<span class="lnr"> 5669 </span>             multipleContexts( part, elements || [ context ], results, seed );
<span class="lnr"> 5670 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 5671 </span>             Sizzle( part, context, results, seed ? seed.concat(elements) : elements );
<span class="lnr"> 5672 </span>          }
<span class="lnr"> 5673 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 5674 </span>          push.apply( results, elements );
<span class="lnr"> 5675 </span>       }
<span class="lnr"> 5676 </span>    }
<span class="lnr"> 5677 </span>
<span class="lnr"> 5678 </span><span class="Comment">    // Do not sort if this is a single filter</span>
<span class="lnr"> 5679 </span>    <span class="Statement">return</span> len === <span class="Constant">1</span> ? results : Sizzle.uniqueSort( results );
<span class="lnr"> 5680 </span>}
<span class="lnr"> 5681 </span>
<span class="lnr"> 5682 </span><span class="Identifier">function</span> select( selector, context, results, seed, xml ) {
<span class="lnr"> 5683 </span><span class="Comment">    // Remove excessive whitespace</span>
<span class="lnr"> 5684 </span>    selector = selector.replace( rtrim, <span class="Constant">&quot;$1&quot;</span> );
<span class="lnr"> 5685 </span>    <span class="Type">var</span> elements, matcher, cached, elem,
<span class="lnr"> 5686 </span>       i, tokens, token, lastToken, findContext, type,
<span class="lnr"> 5687 </span>       match = tokenize( selector, context, xml ),
<span class="lnr"> 5688 </span>       contextNodeType = context.nodeType;
<span class="lnr"> 5689 </span>
<span class="lnr"> 5690 </span><span class="Comment">    // POS handling</span>
<span class="lnr"> 5691 </span>    <span class="Statement">if</span> ( matchExpr[<span class="Constant">&quot;POS&quot;</span>].test(selector) ) {
<span class="lnr"> 5692 </span>       <span class="Statement">return</span> handlePOS( match, context, results, seed );
<span class="lnr"> 5693 </span>    }
<span class="lnr"> 5694 </span>
<span class="lnr"> 5695 </span>    <span class="Statement">if</span> ( seed ) {
<span class="lnr"> 5696 </span>       elements = slice.call( seed, <span class="Constant">0</span> );
<span class="lnr"> 5697 </span>
<span class="lnr"> 5698 </span><span class="Comment">    // To maintain document order, only narrow the</span>
<span class="lnr"> 5699 </span><span class="Comment">    // set if there is one group</span>
<span class="lnr"> 5700 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( match.length === <span class="Constant">1</span> ) {
<span class="lnr"> 5701 </span>
<span class="lnr"> 5702 </span><span class="Comment">       // Take a shortcut and set the context if the root selector is an ID</span>
<span class="lnr"> 5703 </span>       <span class="Statement">if</span> ( (tokens = slice.call( match[<span class="Constant">0</span>], <span class="Constant">0</span> )).length &gt; <span class="Constant">2</span> &amp;&amp;
<span class="lnr"> 5704 </span>             (token = tokens[<span class="Constant">0</span>]).part === <span class="Constant">&quot;ID&quot;</span> &amp;&amp;
<span class="lnr"> 5705 </span>             contextNodeType === <span class="Constant">9</span> &amp;&amp; !xml &amp;&amp;
<span class="lnr"> 5706 </span>             Expr.relative[ tokens[<span class="Constant">1</span>].part ] ) {
<span class="lnr"> 5707 </span>
<span class="lnr"> 5708 </span>          context = Expr.find[<span class="Constant">&quot;ID&quot;</span>]( token.captures[<span class="Constant">0</span>].replace( rbackslash, <span class="Constant">&quot;&quot;</span> ), context, xml )[<span class="Constant">0</span>];
<span class="lnr"> 5709 </span>          <span class="Statement">if</span> ( !context ) {
<span class="lnr"> 5710 </span>             <span class="Statement">return</span> results;
<span class="lnr"> 5711 </span>          }
<span class="lnr"> 5712 </span>
<span class="lnr"> 5713 </span>          selector = selector.slice( tokens.shift().string.length );
<span class="lnr"> 5714 </span>       }
<span class="lnr"> 5715 </span>
<span class="lnr"> 5716 </span>       findContext = ( (match = rsibling.exec( tokens[<span class="Constant">0</span>].string )) &amp;&amp; !match.index &amp;&amp; context.parentNode ) || context;
<span class="lnr"> 5717 </span>
<span class="lnr"> 5718 </span><span class="Comment">       // Reduce the set if possible</span>
<span class="lnr"> 5719 </span>       lastToken = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 5720 </span>       <span class="Statement">for</span> ( i = tokens.length - <span class="Constant">1</span>; i &gt;= <span class="Constant">0</span>; i-- ) {
<span class="lnr"> 5721 </span>          token = tokens[i];
<span class="lnr"> 5722 </span>          type = token.part;
<span class="lnr"> 5723 </span>          lastToken = token.string + lastToken;
<span class="lnr"> 5724 </span>          <span class="Statement">if</span> ( Expr.relative[ type ] ) {
<span class="lnr"> 5725 </span>             <span class="Statement">break</span>;
<span class="lnr"> 5726 </span>          }
<span class="lnr"> 5727 </span>          <span class="Statement">if</span> ( Expr.order.test(type) ) {
<span class="lnr"> 5728 </span>             elements = Expr.find[ type ]( token.captures[<span class="Constant">0</span>].replace( rbackslash, <span class="Constant">&quot;&quot;</span> ), findContext, xml );
<span class="lnr"> 5729 </span>             <span class="Statement">if</span> ( elements == <span class="Type">null</span> ) {
<span class="lnr"> 5730 </span>                <span class="Statement">continue</span>;
<span class="lnr"> 5731 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 5732 </span>                selector = selector.slice( <span class="Constant">0</span>, selector.length - lastToken.length ) +
<span class="lnr"> 5733 </span>                   lastToken.replace( matchExpr[ type ], <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 5734 </span>
<span class="lnr"> 5735 </span>                <span class="Statement">if</span> ( !selector ) {
<span class="lnr"> 5736 </span>                   push.apply( results, slice.call(elements, <span class="Constant">0</span>) );
<span class="lnr"> 5737 </span>                }
<span class="lnr"> 5738 </span>
<span class="lnr"> 5739 </span>                <span class="Statement">break</span>;
<span class="lnr"> 5740 </span>             }
<span class="lnr"> 5741 </span>          }
<span class="lnr"> 5742 </span>       }
<span class="lnr"> 5743 </span>    }
<span class="lnr"> 5744 </span>
<span class="lnr"> 5745 </span><span class="Comment">    // Only loop over the given elements once</span>
<span class="lnr"> 5746 </span>    <span class="Statement">if</span> ( selector ) {
<span class="lnr"> 5747 </span>       matcher = compile( selector, context, xml );
<span class="lnr"> 5748 </span>       dirruns = matcher.dirruns++;
<span class="lnr"> 5749 </span>       <span class="Statement">if</span> ( elements == <span class="Type">null</span> ) {
<span class="lnr"> 5750 </span>          elements = Expr.find[<span class="Constant">&quot;TAG&quot;</span>]( <span class="Constant">&quot;*&quot;</span>, (rsibling.test( selector ) &amp;&amp; context.parentNode) || context );
<span class="lnr"> 5751 </span>       }
<span class="lnr"> 5752 </span>
<span class="lnr"> 5753 </span>       <span class="Statement">for</span> ( i = <span class="Constant">0</span>; (elem = elements[i]); i++ ) {
<span class="lnr"> 5754 </span>          cachedruns = matcher.runs++;
<span class="lnr"> 5755 </span>          <span class="Statement">if</span> ( matcher(elem) ) {
<span class="lnr"> 5756 </span>             results.push( elem );
<span class="lnr"> 5757 </span>          }
<span class="lnr"> 5758 </span>       }
<span class="lnr"> 5759 </span>    }
<span class="lnr"> 5760 </span>
<span class="lnr"> 5761 </span>    <span class="Statement">return</span> results;
<span class="lnr"> 5762 </span>}
<span class="lnr"> 5763 </span>
<span class="lnr"> 5764 </span><span class="Statement">if</span> ( document.querySelectorAll ) {
<span class="lnr"> 5765 </span>    (<span class="Identifier">function</span>() {
<span class="lnr"> 5766 </span>       <span class="Type">var</span> disconnectedMatch,
<span class="lnr"> 5767 </span>          oldSelect = select,
<span class="lnr"> 5768 </span>          rescape = <span class="Constant">/'|</span><span class="Special">\\</span><span class="Constant">/g</span>,
<span class="lnr"> 5769 </span>          rattributeQuotes = <span class="Constant">/</span><span class="Special">\=</span><span class="Constant">[</span><span class="Special">\x20\t\r\n\f</span><span class="Constant">]*([^'&quot;</span><span class="Special">\]</span><span class="Constant">]*)[</span><span class="Special">\x20\t\r\n\f</span><span class="Constant">]*</span><span class="Special">\]</span><span class="Constant">/g</span>,
<span class="lnr"> 5770 </span>          rbuggyQSA = [],
<span class="lnr"> 5771 </span><span class="Comment">          // matchesSelector(:active) reports false when true (IE9/Opera 11.5)</span>
<span class="lnr"> 5772 </span><span class="Comment">          // A support test would require too much code (would include document ready)</span>
<span class="lnr"> 5773 </span><span class="Comment">          // just skip matchesSelector for :active</span>
<span class="lnr"> 5774 </span>          rbuggyMatches = [<span class="Constant">&quot;:active&quot;</span>],
<span class="lnr"> 5775 </span>          matches = docElem.matchesSelector ||
<span class="lnr"> 5776 </span>             docElem.mozMatchesSelector ||
<span class="lnr"> 5777 </span>             docElem.webkitMatchesSelector ||
<span class="lnr"> 5778 </span>             docElem.oMatchesSelector ||
<span class="lnr"> 5779 </span>             docElem.msMatchesSelector;
<span class="lnr"> 5780 </span>
<span class="lnr"> 5781 </span><span class="Comment">       // Build QSA regex</span>
<span class="lnr"> 5782 </span><span class="Comment">       // Regex strategy adopted from Diego Perini</span>
<span class="lnr"> 5783 </span>       assert(<span class="Identifier">function</span>( div ) {
<span class="lnr"> 5784 </span><span class="Comment">          // Select is set to empty string on purpose</span>
<span class="lnr"> 5785 </span><span class="Comment">          // This is to test IE's treatment of not explictly</span>
<span class="lnr"> 5786 </span><span class="Comment">          // setting a boolean content attribute,</span>
<span class="lnr"> 5787 </span><span class="Comment">          // since its presence should be enough</span>
<span class="lnr"> 5788 </span><span class="Comment">          // <a href="http://bugs.jquery.com/ticket/12359">http://bugs.jquery.com/ticket/12359</a></span>
<span class="lnr"> 5789 </span>          div.innerHTML = <span class="Constant">&quot;&lt;select&gt;&lt;option selected=''&gt;&lt;/option&gt;&lt;/select&gt;&quot;</span>;
<span class="lnr"> 5790 </span>
<span class="lnr"> 5791 </span><span class="Comment">          // IE8 - Some boolean attributes are not treated correctly</span>
<span class="lnr"> 5792 </span>          <span class="Statement">if</span> ( !div.querySelectorAll(<span class="Constant">&quot;[selected]&quot;</span>).length ) {
<span class="lnr"> 5793 </span>             rbuggyQSA.push( <span class="Constant">&quot;</span><span class="Special">\\</span><span class="Constant">[&quot;</span> + whitespace + <span class="Constant">&quot;*(?:checked|disabled|ismap|multiple|readonly|selected|value)&quot;</span> );
<span class="lnr"> 5794 </span>          }
<span class="lnr"> 5795 </span>
<span class="lnr"> 5796 </span><span class="Comment">          // Webkit/Opera - :checked should return selected option elements</span>
<span class="lnr"> 5797 </span><span class="Comment">          // <a href="http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked">http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked</a></span>
<span class="lnr"> 5798 </span><span class="Comment">          // IE8 throws error here (do not put tests after this one)</span>
<span class="lnr"> 5799 </span>          <span class="Statement">if</span> ( !div.querySelectorAll(<span class="Constant">&quot;:checked&quot;</span>).length ) {
<span class="lnr"> 5800 </span>             rbuggyQSA.push(<span class="Constant">&quot;:checked&quot;</span>);
<span class="lnr"> 5801 </span>          }
<span class="lnr"> 5802 </span>       });
<span class="lnr"> 5803 </span>
<span class="lnr"> 5804 </span>       assert(<span class="Identifier">function</span>( div ) {
<span class="lnr"> 5805 </span>
<span class="lnr"> 5806 </span><span class="Comment">          // Opera 10-12/IE9 - ^= $= *= and empty values</span>
<span class="lnr"> 5807 </span><span class="Comment">          // Should not select anything</span>
<span class="lnr"> 5808 </span>          div.innerHTML = <span class="Constant">&quot;&lt;p test=''&gt;&lt;/p&gt;&quot;</span>;
<span class="lnr"> 5809 </span>          <span class="Statement">if</span> ( div.querySelectorAll(<span class="Constant">&quot;[test^='']&quot;</span>).length ) {
<span class="lnr"> 5810 </span>             rbuggyQSA.push( <span class="Constant">&quot;[*^$]=&quot;</span> + whitespace + <span class="Constant">&quot;*(?:</span><span class="Special">\&quot;\&quot;</span><span class="Constant">|'')&quot;</span> );
<span class="lnr"> 5811 </span>          }
<span class="lnr"> 5812 </span>
<span class="lnr"> 5813 </span><span class="Comment">          // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)</span>
<span class="lnr"> 5814 </span><span class="Comment">          // IE8 throws error here (do not put tests after this one)</span>
<span class="lnr"> 5815 </span>          div.innerHTML = <span class="Constant">&quot;&lt;input type='hidden'/&gt;&quot;</span>;
<span class="lnr"> 5816 </span>          <span class="Statement">if</span> ( !div.querySelectorAll(<span class="Constant">&quot;:enabled&quot;</span>).length ) {
<span class="lnr"> 5817 </span>             rbuggyQSA.push(<span class="Constant">&quot;:enabled&quot;</span>, <span class="Constant">&quot;:disabled&quot;</span>);
<span class="lnr"> 5818 </span>          }
<span class="lnr"> 5819 </span>       });
<span class="lnr"> 5820 </span>
<span class="lnr"> 5821 </span>       rbuggyQSA = rbuggyQSA.length &amp;&amp; <span class="Statement">new</span> <span class="Special">RegExp</span>( rbuggyQSA.join(<span class="Constant">&quot;|&quot;</span>) );
<span class="lnr"> 5822 </span>
<span class="lnr"> 5823 </span>       select = <span class="Identifier">function</span>( selector, context, results, seed, xml ) {
<span class="lnr"> 5824 </span><span class="Comment">          // Only use querySelectorAll when not filtering,</span>
<span class="lnr"> 5825 </span><span class="Comment">          // when this is not xml,</span>
<span class="lnr"> 5826 </span><span class="Comment">          // and when no QSA bugs apply</span>
<span class="lnr"> 5827 </span>          <span class="Statement">if</span> ( !seed &amp;&amp; !xml &amp;&amp; (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
<span class="lnr"> 5828 </span>             <span class="Statement">if</span> ( context.nodeType === <span class="Constant">9</span> ) {
<span class="lnr"> 5829 </span>                <span class="Statement">try</span> {
<span class="lnr"> 5830 </span>                   push.apply( results, slice.call(context.querySelectorAll( selector ), <span class="Constant">0</span>) );
<span class="lnr"> 5831 </span>                   <span class="Statement">return</span> results;
<span class="lnr"> 5832 </span>                } <span class="Statement">catch</span>(qsaError) {}
<span class="lnr"> 5833 </span><span class="Comment">             // qSA works strangely on Element-rooted queries</span>
<span class="lnr"> 5834 </span><span class="Comment">             // We can work around this by specifying an extra ID on the root</span>
<span class="lnr"> 5835 </span><span class="Comment">             // and working up from there (Thanks to Andrew Dupont for the technique)</span>
<span class="lnr"> 5836 </span><span class="Comment">             // IE 8 doesn't work on object elements</span>
<span class="lnr"> 5837 </span>             } <span class="Statement">else</span> <span class="Statement">if</span> ( context.nodeType === <span class="Constant">1</span> &amp;&amp; context.nodeName.toLowerCase() !== <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 5838 </span>                <span class="Type">var</span> groups, i, len,
<span class="lnr"> 5839 </span>                   old = context.getAttribute(<span class="Constant">&quot;id&quot;</span>),
<span class="lnr"> 5840 </span>                   nid = old || expando,
<span class="lnr"> 5841 </span>                   newContext = rsibling.test( selector ) &amp;&amp; context.parentNode || context;
<span class="lnr"> 5842 </span>
<span class="lnr"> 5843 </span>                <span class="Statement">if</span> ( old ) {
<span class="lnr"> 5844 </span>                   nid = nid.replace( rescape, <span class="Constant">&quot;</span><span class="Special">\\</span><span class="Constant">$&amp;&quot;</span> );
<span class="lnr"> 5845 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 5846 </span>                   context.setAttribute( <span class="Constant">&quot;id&quot;</span>, nid );
<span class="lnr"> 5847 </span>                }
<span class="lnr"> 5848 </span>
<span class="lnr"> 5849 </span>                groups = tokenize(selector, context, xml);
<span class="lnr"> 5850 </span><span class="Comment">                // Trailing space is unnecessary</span>
<span class="lnr"> 5851 </span><span class="Comment">                // There is always a context check</span>
<span class="lnr"> 5852 </span>                nid = <span class="Constant">&quot;[id='&quot;</span> + nid + <span class="Constant">&quot;']&quot;</span>;
<span class="lnr"> 5853 </span>                <span class="Statement">for</span> ( i = <span class="Constant">0</span>, len = groups.length; i &lt; len; i++ ) {
<span class="lnr"> 5854 </span>                   groups[i] = nid + groups[i].selector;
<span class="lnr"> 5855 </span>                }
<span class="lnr"> 5856 </span>                <span class="Statement">try</span> {
<span class="lnr"> 5857 </span>                   push.apply( results, slice.call( newContext.querySelectorAll(
<span class="lnr"> 5858 </span>                      groups.join(<span class="Constant">&quot;,&quot;</span>)
<span class="lnr"> 5859 </span>                   ), <span class="Constant">0</span> ) );
<span class="lnr"> 5860 </span>                   <span class="Statement">return</span> results;
<span class="lnr"> 5861 </span>                } <span class="Statement">catch</span>(qsaError) {
<span class="lnr"> 5862 </span>                } <span class="Statement">finally</span> {
<span class="lnr"> 5863 </span>                   <span class="Statement">if</span> ( !old ) {
<span class="lnr"> 5864 </span>                      context.removeAttribute(<span class="Constant">&quot;id&quot;</span>);
<span class="lnr"> 5865 </span>                   }
<span class="lnr"> 5866 </span>                }
<span class="lnr"> 5867 </span>             }
<span class="lnr"> 5868 </span>          }
<span class="lnr"> 5869 </span>
<span class="lnr"> 5870 </span>          <span class="Statement">return</span> oldSelect( selector, context, results, seed, xml );
<span class="lnr"> 5871 </span>       };
<span class="lnr"> 5872 </span>
<span class="lnr"> 5873 </span>       <span class="Statement">if</span> ( matches ) {
<span class="lnr"> 5874 </span>          assert(<span class="Identifier">function</span>( div ) {
<span class="lnr"> 5875 </span><span class="Comment">             // Check to see if it's possible to do matchesSelector</span>
<span class="lnr"> 5876 </span><span class="Comment">             // on a disconnected node (IE 9)</span>
<span class="lnr"> 5877 </span>             disconnectedMatch = matches.call( div, <span class="Constant">&quot;div&quot;</span> );
<span class="lnr"> 5878 </span>
<span class="lnr"> 5879 </span><span class="Comment">             // This should fail with an exception</span>
<span class="lnr"> 5880 </span><span class="Comment">             // Gecko does not error, returns false instead</span>
<span class="lnr"> 5881 </span>             <span class="Statement">try</span> {
<span class="lnr"> 5882 </span>                matches.call( div, <span class="Constant">&quot;[test!='']:sizzle&quot;</span> );
<span class="lnr"> 5883 </span>                rbuggyMatches.push( matchExpr[<span class="Constant">&quot;PSEUDO&quot;</span>].source, matchExpr[<span class="Constant">&quot;POS&quot;</span>].source, <span class="Constant">&quot;!=&quot;</span> );
<span class="lnr"> 5884 </span>             } <span class="Statement">catch</span> ( e ) {}
<span class="lnr"> 5885 </span>          });
<span class="lnr"> 5886 </span>
<span class="lnr"> 5887 </span><span class="Comment">          // rbuggyMatches always contains :active, so no need for a length check</span>
<span class="lnr"> 5888 </span>          rbuggyMatches = <span class="Comment">/* rbuggyMatches.length &amp;&amp; */</span> <span class="Statement">new</span> <span class="Special">RegExp</span>( rbuggyMatches.join(<span class="Constant">&quot;|&quot;</span>) );
<span class="lnr"> 5889 </span>
<span class="lnr"> 5890 </span>          Sizzle.matchesSelector = <span class="Identifier">function</span>( elem, expr ) {
<span class="lnr"> 5891 </span><span class="Comment">             // Make sure that attribute selectors are quoted</span>
<span class="lnr"> 5892 </span>             expr = expr.replace( rattributeQuotes, <span class="Constant">&quot;='$1']&quot;</span> );
<span class="lnr"> 5893 </span>
<span class="lnr"> 5894 </span><span class="Comment">             // rbuggyMatches always contains :active, so no need for an existence check</span>
<span class="lnr"> 5895 </span>             <span class="Statement">if</span> ( !isXML( elem ) &amp;&amp; !rbuggyMatches.test( expr ) &amp;&amp; (!rbuggyQSA || !rbuggyQSA.test( expr )) ) {
<span class="lnr"> 5896 </span>                <span class="Statement">try</span> {
<span class="lnr"> 5897 </span>                   <span class="Type">var</span> ret = matches.call( elem, expr );
<span class="lnr"> 5898 </span>
<span class="lnr"> 5899 </span><span class="Comment">                   // IE 9's matchesSelector returns false on disconnected nodes</span>
<span class="lnr"> 5900 </span>                   <span class="Statement">if</span> ( ret || disconnectedMatch ||
<span class="lnr"> 5901 </span><span class="Comment">                         // As well, disconnected nodes are said to be in a document</span>
<span class="lnr"> 5902 </span><span class="Comment">                         // fragment in IE 9</span>
<span class="lnr"> 5903 </span>                         elem.document &amp;&amp; elem.document.nodeType !== <span class="Constant">11</span> ) {
<span class="lnr"> 5904 </span>                      <span class="Statement">return</span> ret;
<span class="lnr"> 5905 </span>                   }
<span class="lnr"> 5906 </span>                } <span class="Statement">catch</span>(e) {}
<span class="lnr"> 5907 </span>             }
<span class="lnr"> 5908 </span>
<span class="lnr"> 5909 </span>             <span class="Statement">return</span> Sizzle( expr, <span class="Type">null</span>, <span class="Type">null</span>, [ elem ] ).length &gt; <span class="Constant">0</span>;
<span class="lnr"> 5910 </span>          };
<span class="lnr"> 5911 </span>       }
<span class="lnr"> 5912 </span>    })();
<span class="lnr"> 5913 </span>}
<span class="lnr"> 5914 </span>
<span class="lnr"> 5915 </span><span class="Comment">// Deprecated</span>
<span class="lnr"> 5916 </span>Expr.setFilters[<span class="Constant">&quot;nth&quot;</span>] = Expr.setFilters[<span class="Constant">&quot;eq&quot;</span>];
<span class="lnr"> 5917 </span>
<span class="lnr"> 5918 </span><span class="Comment">// Back-compat</span>
<span class="lnr"> 5919 </span>Expr.filters = Expr.pseudos;
<span class="lnr"> 5920 </span>
<span class="lnr"> 5921 </span><span class="Comment">// Override sizzle attribute retrieval</span>
<span class="lnr"> 5922 </span>Sizzle.attr = jQuery.attr;
<span class="lnr"> 5923 </span>jQuery.find = Sizzle;
<span class="lnr"> 5924 </span>jQuery.expr = Sizzle.selectors;
<span class="lnr"> 5925 </span>jQuery.expr[<span class="Constant">&quot;:&quot;</span>] = jQuery.expr.pseudos;
<span class="lnr"> 5926 </span>jQuery.unique = Sizzle.uniqueSort;
<span class="lnr"> 5927 </span>jQuery.text = Sizzle.getText;
<span class="lnr"> 5928 </span>jQuery.isXMLDoc = Sizzle.isXML;
<span class="lnr"> 5929 </span>jQuery.contains = Sizzle.contains;
<span class="lnr"> 5930 </span>
<span class="lnr"> 5931 </span>
<span class="lnr"> 5932 </span>})( window );
<span class="lnr"> 5933 </span><span class="Type">var</span> runtil = <span class="Constant">/Until$/</span>,
<span class="lnr"> 5934 </span>    rparentsprev = <span class="Constant">/^(?:parents|prev(?:Until|All))/</span>,
<span class="lnr"> 5935 </span>    isSimple = <span class="Constant">/^.[^:#</span><span class="Special">\[\.</span><span class="Constant">,]*$/</span>,
<span class="lnr"> 5936 </span>    rneedsContext = jQuery.expr.match.needsContext,
<span class="lnr"> 5937 </span><span class="Comment">    // methods guaranteed to produce a unique set when starting from a unique set</span>
<span class="lnr"> 5938 </span>    guaranteedUnique = {
<span class="lnr"> 5939 </span>       <span class="Statement">children</span>: <span class="Constant">true</span>,
<span class="lnr"> 5940 </span>       <span class="Statement">contents</span>: <span class="Constant">true</span>,
<span class="lnr"> 5941 </span>       <span class="Statement">next</span>: <span class="Constant">true</span>,
<span class="lnr"> 5942 </span>       <span class="Statement">prev</span>: <span class="Constant">true</span>
<span class="lnr"> 5943 </span>    };
<span class="lnr"> 5944 </span>
<span class="lnr"> 5945 </span>jQuery.fn.extend({
<span class="lnr"> 5946 </span>    <span class="Statement">find</span>: <span class="Identifier">function</span>( selector ) {
<span class="lnr"> 5947 </span>       <span class="Type">var</span> i, l, length, n, r, ret,
<span class="lnr"> 5948 </span>          self = <span class="Type">this</span>;
<span class="lnr"> 5949 </span>
<span class="lnr"> 5950 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> selector !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 5951 </span>          <span class="Statement">return</span> jQuery( selector ).filter(<span class="Identifier">function</span>() {
<span class="lnr"> 5952 </span>             <span class="Statement">for</span> ( i = <span class="Constant">0</span>, l = self.length; i &lt; l; i++ ) {
<span class="lnr"> 5953 </span>                <span class="Statement">if</span> ( jQuery.contains( self[ i ], <span class="Type">this</span> ) ) {
<span class="lnr"> 5954 </span>                   <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 5955 </span>                }
<span class="lnr"> 5956 </span>             }
<span class="lnr"> 5957 </span>          });
<span class="lnr"> 5958 </span>       }
<span class="lnr"> 5959 </span>
<span class="lnr"> 5960 </span>       ret = <span class="Type">this</span>.pushStack( <span class="Constant">&quot;&quot;</span>, <span class="Constant">&quot;find&quot;</span>, selector );
<span class="lnr"> 5961 </span>
<span class="lnr"> 5962 </span>       <span class="Statement">for</span> ( i = <span class="Constant">0</span>, l = <span class="Type">this</span>.length; i &lt; l; i++ ) {
<span class="lnr"> 5963 </span>          length = ret.length;
<span class="lnr"> 5964 </span>          jQuery.find( selector, <span class="Type">this</span>[i], ret );
<span class="lnr"> 5965 </span>
<span class="lnr"> 5966 </span>          <span class="Statement">if</span> ( i &gt; <span class="Constant">0</span> ) {
<span class="lnr"> 5967 </span><span class="Comment">             // Make sure that the results are unique</span>
<span class="lnr"> 5968 </span>             <span class="Statement">for</span> ( n = length; n &lt; ret.length; n++ ) {
<span class="lnr"> 5969 </span>                <span class="Statement">for</span> ( r = <span class="Constant">0</span>; r &lt; length; r++ ) {
<span class="lnr"> 5970 </span>                   <span class="Statement">if</span> ( ret[r] === ret[n] ) {
<span class="lnr"> 5971 </span>                      ret.splice(n--, <span class="Constant">1</span>);
<span class="lnr"> 5972 </span>                      <span class="Statement">break</span>;
<span class="lnr"> 5973 </span>                   }
<span class="lnr"> 5974 </span>                }
<span class="lnr"> 5975 </span>             }
<span class="lnr"> 5976 </span>          }
<span class="lnr"> 5977 </span>       }
<span class="lnr"> 5978 </span>
<span class="lnr"> 5979 </span>       <span class="Statement">return</span> ret;
<span class="lnr"> 5980 </span>    },
<span class="lnr"> 5981 </span>
<span class="lnr"> 5982 </span>    <span class="Statement">has</span>: <span class="Identifier">function</span>( target ) {
<span class="lnr"> 5983 </span>       <span class="Type">var</span> i,
<span class="lnr"> 5984 </span>          targets = jQuery( target, <span class="Type">this</span> ),
<span class="lnr"> 5985 </span>          len = targets.length;
<span class="lnr"> 5986 </span>
<span class="lnr"> 5987 </span>       <span class="Statement">return</span> <span class="Type">this</span>.filter(<span class="Identifier">function</span>() {
<span class="lnr"> 5988 </span>          <span class="Statement">for</span> ( i = <span class="Constant">0</span>; i &lt; len; i++ ) {
<span class="lnr"> 5989 </span>             <span class="Statement">if</span> ( jQuery.contains( <span class="Type">this</span>, targets[i] ) ) {
<span class="lnr"> 5990 </span>                <span class="Statement">return</span> <span class="Constant">true</span>;
<span class="lnr"> 5991 </span>             }
<span class="lnr"> 5992 </span>          }
<span class="lnr"> 5993 </span>       });
<span class="lnr"> 5994 </span>    },
<span class="lnr"> 5995 </span>
<span class="lnr"> 5996 </span>    <span class="Statement">not</span>: <span class="Identifier">function</span>( selector ) {
<span class="lnr"> 5997 </span>       <span class="Statement">return</span> <span class="Type">this</span>.pushStack( winnow(<span class="Type">this</span>, selector, <span class="Constant">false</span>), <span class="Constant">&quot;not&quot;</span>, selector);
<span class="lnr"> 5998 </span>    },
<span class="lnr"> 5999 </span>
<span class="lnr"> 6000 </span>    <span class="Statement">filter</span>: <span class="Identifier">function</span>( selector ) {
<span class="lnr"> 6001 </span>       <span class="Statement">return</span> <span class="Type">this</span>.pushStack( winnow(<span class="Type">this</span>, selector, <span class="Constant">true</span>), <span class="Constant">&quot;filter&quot;</span>, selector );
<span class="lnr"> 6002 </span>    },
<span class="lnr"> 6003 </span>
<span class="lnr"> 6004 </span>    <span class="Statement">is</span>: <span class="Identifier">function</span>( selector ) {
<span class="lnr"> 6005 </span>       <span class="Statement">return</span> !!selector &amp;&amp; (
<span class="lnr"> 6006 </span>          <span class="Statement">typeof</span> selector === <span class="Constant">&quot;string&quot;</span> ?
<span class="lnr"> 6007 </span><span class="Comment">             // If this is a positional/relative selector, check membership in the returned set</span>
<span class="lnr"> 6008 </span><span class="Comment">             // so $(&quot;p:first&quot;).is(&quot;p:last&quot;) won't return true for a doc with two &quot;p&quot;.</span>
<span class="lnr"> 6009 </span>             rneedsContext.test( selector ) ?
<span class="lnr"> 6010 </span>                jQuery( selector, <span class="Type">this</span>.context ).index( <span class="Type">this</span>[<span class="Constant">0</span>] ) &gt;= <span class="Statement">0</span> :
<span class="lnr"> 6011 </span>                jQuery.filter( selector, <span class="Type">this</span> ).length &gt; <span class="Statement">0</span> :
<span class="lnr"> 6012 </span>             <span class="Type">this</span>.filter( selector ).length &gt; <span class="Constant">0</span> );
<span class="lnr"> 6013 </span>    },
<span class="lnr"> 6014 </span>
<span class="lnr"> 6015 </span>    <span class="Statement">closest</span>: <span class="Identifier">function</span>( selectors, context ) {
<span class="lnr"> 6016 </span>       <span class="Type">var</span> cur,
<span class="lnr"> 6017 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 6018 </span>          l = <span class="Type">this</span>.length,
<span class="lnr"> 6019 </span>          ret = [],
<span class="lnr"> 6020 </span>          pos = rneedsContext.test( selectors ) || <span class="Statement">typeof</span> selectors !== <span class="Constant">&quot;string&quot;</span> ?
<span class="lnr"> 6021 </span>             jQuery( selectors, context || <span class="Type">this</span>.context ) :
<span class="lnr"> 6022 </span>             <span class="Constant">0</span>;
<span class="lnr"> 6023 </span>
<span class="lnr"> 6024 </span>       <span class="Statement">for</span> ( ; i &lt; l; i++ ) {
<span class="lnr"> 6025 </span>          cur = <span class="Type">this</span>[i];
<span class="lnr"> 6026 </span>
<span class="lnr"> 6027 </span>          <span class="Statement">while</span> ( cur &amp;&amp; cur.ownerDocument &amp;&amp; cur !== context &amp;&amp; cur.nodeType !== <span class="Constant">11</span> ) {
<span class="lnr"> 6028 </span>             <span class="Statement">if</span> ( pos ? pos.index(cur) &gt; -<span class="Statement">1</span> : jQuery.find.matchesSelector(cur, selectors) ) {
<span class="lnr"> 6029 </span>                ret.push( cur );
<span class="lnr"> 6030 </span>                <span class="Statement">break</span>;
<span class="lnr"> 6031 </span>             }
<span class="lnr"> 6032 </span>             cur = cur.parentNode;
<span class="lnr"> 6033 </span>          }
<span class="lnr"> 6034 </span>       }
<span class="lnr"> 6035 </span>
<span class="lnr"> 6036 </span>       ret = ret.length &gt; <span class="Constant">1</span> ? jQuery.unique( ret ) : ret;
<span class="lnr"> 6037 </span>
<span class="lnr"> 6038 </span>       <span class="Statement">return</span> <span class="Type">this</span>.pushStack( ret, <span class="Constant">&quot;closest&quot;</span>, selectors );
<span class="lnr"> 6039 </span>    },
<span class="lnr"> 6040 </span>
<span class="lnr"> 6041 </span><span class="Comment">    // Determine the position of an element within</span>
<span class="lnr"> 6042 </span><span class="Comment">    // the matched set of elements</span>
<span class="lnr"> 6043 </span>    <span class="Statement">index</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6044 </span>
<span class="lnr"> 6045 </span><span class="Comment">       // No argument, return index in parent</span>
<span class="lnr"> 6046 </span>       <span class="Statement">if</span> ( !elem ) {
<span class="lnr"> 6047 </span>          <span class="Statement">return</span> ( <span class="Type">this</span>[<span class="Constant">0</span>] &amp;&amp; <span class="Type">this</span>[<span class="Constant">0</span>].parentNode ) ? <span class="Type">this</span>.prevAll().<span class="Statement">length</span> : -<span class="Constant">1</span>;
<span class="lnr"> 6048 </span>       }
<span class="lnr"> 6049 </span>
<span class="lnr"> 6050 </span><span class="Comment">       // index in selector</span>
<span class="lnr"> 6051 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 6052 </span>          <span class="Statement">return</span> jQuery.inArray( <span class="Type">this</span>[<span class="Constant">0</span>], jQuery( elem ) );
<span class="lnr"> 6053 </span>       }
<span class="lnr"> 6054 </span>
<span class="lnr"> 6055 </span><span class="Comment">       // Locate the position of the desired element</span>
<span class="lnr"> 6056 </span>       <span class="Statement">return</span> jQuery.inArray(
<span class="lnr"> 6057 </span><span class="Comment">          // If it receives a jQuery object, the first element is used</span>
<span class="lnr"> 6058 </span>          elem.jquery ? elem[<span class="Constant">0</span>] : elem, <span class="Type">this</span> );
<span class="lnr"> 6059 </span>    },
<span class="lnr"> 6060 </span>
<span class="lnr"> 6061 </span>    <span class="Statement">add</span>: <span class="Identifier">function</span>( selector, context ) {
<span class="lnr"> 6062 </span>       <span class="Type">var</span> set = <span class="Statement">typeof</span> selector === <span class="Constant">&quot;string&quot;</span> ?
<span class="lnr"> 6063 </span>             jQuery( selector, context ) :
<span class="lnr"> 6064 </span>             jQuery.makeArray( selector &amp;&amp; selector.nodeType ? [ selector ] : selector ),
<span class="lnr"> 6065 </span>          all = jQuery.merge( <span class="Type">this</span>.get(), set );
<span class="lnr"> 6066 </span>
<span class="lnr"> 6067 </span>       <span class="Statement">return</span> <span class="Type">this</span>.pushStack( isDisconnected( set[<span class="Constant">0</span>] ) || isDisconnected( all[<span class="Constant">0</span>] ) ?
<span class="lnr"> 6068 </span>          <span class="Statement">all</span> :
<span class="lnr"> 6069 </span>          jQuery.unique( all ) );
<span class="lnr"> 6070 </span>    },
<span class="lnr"> 6071 </span>
<span class="lnr"> 6072 </span>    <span class="Statement">addBack</span>: <span class="Identifier">function</span>( selector ) {
<span class="lnr"> 6073 </span>       <span class="Statement">return</span> <span class="Type">this</span>.add( selector == <span class="Type">null</span> ?
<span class="lnr"> 6074 </span>          <span class="Type">this</span>.<span class="Statement">prevObject</span> : <span class="Type">this</span>.prevObject.filter(selector)
<span class="lnr"> 6075 </span>       );
<span class="lnr"> 6076 </span>    }
<span class="lnr"> 6077 </span>});
<span class="lnr"> 6078 </span>
<span class="lnr"> 6079 </span>jQuery.fn.andSelf = jQuery.fn.addBack;
<span class="lnr"> 6080 </span>
<span class="lnr"> 6081 </span><span class="Comment">// A painfully simple check to see if an element is disconnected</span>
<span class="lnr"> 6082 </span><span class="Comment">// from a document (should be improved, where feasible).</span>
<span class="lnr"> 6083 </span><span class="Identifier">function</span> isDisconnected( node ) {
<span class="lnr"> 6084 </span>    <span class="Statement">return</span> !node || !node.parentNode || node.parentNode.nodeType === <span class="Constant">11</span>;
<span class="lnr"> 6085 </span>}
<span class="lnr"> 6086 </span>
<span class="lnr"> 6087 </span><span class="Identifier">function</span> sibling( cur, dir ) {
<span class="lnr"> 6088 </span>    <span class="Statement">do</span> {
<span class="lnr"> 6089 </span>       cur = cur[ dir ];
<span class="lnr"> 6090 </span>    } <span class="Statement">while</span> ( cur &amp;&amp; cur.nodeType !== <span class="Constant">1</span> );
<span class="lnr"> 6091 </span>
<span class="lnr"> 6092 </span>    <span class="Statement">return</span> cur;
<span class="lnr"> 6093 </span>}
<span class="lnr"> 6094 </span>
<span class="lnr"> 6095 </span>jQuery.each({
<span class="lnr"> 6096 </span>    <span class="Statement">parent</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6097 </span>       <span class="Type">var</span> parent = elem.parentNode;
<span class="lnr"> 6098 </span>       <span class="Statement">return</span> parent &amp;&amp; parent.nodeType !== <span class="Constant">11</span> ? parent : <span class="Type">null</span>;
<span class="lnr"> 6099 </span>    },
<span class="lnr"> 6100 </span>    <span class="Statement">parents</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6101 </span>       <span class="Statement">return</span> jQuery.dir( elem, <span class="Constant">&quot;parentNode&quot;</span> );
<span class="lnr"> 6102 </span>    },
<span class="lnr"> 6103 </span>    <span class="Statement">parentsUntil</span>: <span class="Identifier">function</span>( elem, i, until ) {
<span class="lnr"> 6104 </span>       <span class="Statement">return</span> jQuery.dir( elem, <span class="Constant">&quot;parentNode&quot;</span>, until );
<span class="lnr"> 6105 </span>    },
<span class="lnr"> 6106 </span>    <span class="Statement">next</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6107 </span>       <span class="Statement">return</span> sibling( elem, <span class="Constant">&quot;nextSibling&quot;</span> );
<span class="lnr"> 6108 </span>    },
<span class="lnr"> 6109 </span>    <span class="Statement">prev</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6110 </span>       <span class="Statement">return</span> sibling( elem, <span class="Constant">&quot;previousSibling&quot;</span> );
<span class="lnr"> 6111 </span>    },
<span class="lnr"> 6112 </span>    <span class="Statement">nextAll</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6113 </span>       <span class="Statement">return</span> jQuery.dir( elem, <span class="Constant">&quot;nextSibling&quot;</span> );
<span class="lnr"> 6114 </span>    },
<span class="lnr"> 6115 </span>    <span class="Statement">prevAll</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6116 </span>       <span class="Statement">return</span> jQuery.dir( elem, <span class="Constant">&quot;previousSibling&quot;</span> );
<span class="lnr"> 6117 </span>    },
<span class="lnr"> 6118 </span>    <span class="Statement">nextUntil</span>: <span class="Identifier">function</span>( elem, i, until ) {
<span class="lnr"> 6119 </span>       <span class="Statement">return</span> jQuery.dir( elem, <span class="Constant">&quot;nextSibling&quot;</span>, until );
<span class="lnr"> 6120 </span>    },
<span class="lnr"> 6121 </span>    <span class="Statement">prevUntil</span>: <span class="Identifier">function</span>( elem, i, until ) {
<span class="lnr"> 6122 </span>       <span class="Statement">return</span> jQuery.dir( elem, <span class="Constant">&quot;previousSibling&quot;</span>, until );
<span class="lnr"> 6123 </span>    },
<span class="lnr"> 6124 </span>    <span class="Statement">siblings</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6125 </span>       <span class="Statement">return</span> jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
<span class="lnr"> 6126 </span>    },
<span class="lnr"> 6127 </span>    <span class="Statement">children</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6128 </span>       <span class="Statement">return</span> jQuery.sibling( elem.firstChild );
<span class="lnr"> 6129 </span>    },
<span class="lnr"> 6130 </span>    <span class="Statement">contents</span>: <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6131 </span>       <span class="Statement">return</span> jQuery.nodeName( elem, <span class="Constant">&quot;iframe&quot;</span> ) ?
<span class="lnr"> 6132 </span>          elem.contentDocument || elem.contentWindow.<span class="Statement">document</span> :
<span class="lnr"> 6133 </span>          jQuery.merge( [], elem.childNodes );
<span class="lnr"> 6134 </span>    }
<span class="lnr"> 6135 </span>}, <span class="Identifier">function</span>( name, fn ) {
<span class="lnr"> 6136 </span>    jQuery.fn[ name ] = <span class="Identifier">function</span>( until, selector ) {
<span class="lnr"> 6137 </span>       <span class="Type">var</span> ret = jQuery.map( <span class="Type">this</span>, fn, until );
<span class="lnr"> 6138 </span>
<span class="lnr"> 6139 </span>       <span class="Statement">if</span> ( !runtil.test( name ) ) {
<span class="lnr"> 6140 </span>          selector = until;
<span class="lnr"> 6141 </span>       }
<span class="lnr"> 6142 </span>
<span class="lnr"> 6143 </span>       <span class="Statement">if</span> ( selector &amp;&amp; <span class="Statement">typeof</span> selector === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 6144 </span>          ret = jQuery.filter( selector, ret );
<span class="lnr"> 6145 </span>       }
<span class="lnr"> 6146 </span>
<span class="lnr"> 6147 </span>       ret = <span class="Type">this</span>.length &gt; <span class="Constant">1</span> &amp;&amp; !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
<span class="lnr"> 6148 </span>
<span class="lnr"> 6149 </span>       <span class="Statement">if</span> ( <span class="Type">this</span>.length &gt; <span class="Constant">1</span> &amp;&amp; rparentsprev.test( name ) ) {
<span class="lnr"> 6150 </span>          ret = ret.reverse();
<span class="lnr"> 6151 </span>       }
<span class="lnr"> 6152 </span>
<span class="lnr"> 6153 </span>       <span class="Statement">return</span> <span class="Type">this</span>.pushStack( ret, name, core_slice.call( arguments ).join(<span class="Constant">&quot;,&quot;</span>) );
<span class="lnr"> 6154 </span>    };
<span class="lnr"> 6155 </span>});
<span class="lnr"> 6156 </span>
<span class="lnr"> 6157 </span>jQuery.extend({
<span class="lnr"> 6158 </span>    <span class="Statement">filter</span>: <span class="Identifier">function</span>( expr, elems, not ) {
<span class="lnr"> 6159 </span>       <span class="Statement">if</span> ( not ) {
<span class="lnr"> 6160 </span>          expr = <span class="Constant">&quot;:not(&quot;</span> + expr + <span class="Constant">&quot;)&quot;</span>;
<span class="lnr"> 6161 </span>       }
<span class="lnr"> 6162 </span>
<span class="lnr"> 6163 </span>       <span class="Statement">return</span> elems.length === <span class="Constant">1</span> ?
<span class="lnr"> 6164 </span>          jQuery.find.matchesSelector(elems[<span class="Constant">0</span>], expr) ? [ elems[<span class="Constant">0</span>] ] : [] :
<span class="lnr"> 6165 </span>          jQuery.find.matches(expr, elems);
<span class="lnr"> 6166 </span>    },
<span class="lnr"> 6167 </span>
<span class="lnr"> 6168 </span>    <span class="Statement">dir</span>: <span class="Identifier">function</span>( elem, dir, until ) {
<span class="lnr"> 6169 </span>       <span class="Type">var</span> matched = [],
<span class="lnr"> 6170 </span>          cur = elem[ dir ];
<span class="lnr"> 6171 </span>
<span class="lnr"> 6172 </span>       <span class="Statement">while</span> ( cur &amp;&amp; cur.nodeType !== <span class="Constant">9</span> &amp;&amp; (until === <span class="Type">undefined</span> || cur.nodeType !== <span class="Constant">1</span> || !jQuery( cur ).is( until )) ) {
<span class="lnr"> 6173 </span>          <span class="Statement">if</span> ( cur.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 6174 </span>             matched.push( cur );
<span class="lnr"> 6175 </span>          }
<span class="lnr"> 6176 </span>          cur = cur[dir];
<span class="lnr"> 6177 </span>       }
<span class="lnr"> 6178 </span>       <span class="Statement">return</span> matched;
<span class="lnr"> 6179 </span>    },
<span class="lnr"> 6180 </span>
<span class="lnr"> 6181 </span>    <span class="Statement">sibling</span>: <span class="Identifier">function</span>( n, elem ) {
<span class="lnr"> 6182 </span>       <span class="Type">var</span> r = [];
<span class="lnr"> 6183 </span>
<span class="lnr"> 6184 </span>       <span class="Statement">for</span> ( ; n; n = n.nextSibling ) {
<span class="lnr"> 6185 </span>          <span class="Statement">if</span> ( n.nodeType === <span class="Constant">1</span> &amp;&amp; n !== elem ) {
<span class="lnr"> 6186 </span>             r.push( n );
<span class="lnr"> 6187 </span>          }
<span class="lnr"> 6188 </span>       }
<span class="lnr"> 6189 </span>
<span class="lnr"> 6190 </span>       <span class="Statement">return</span> r;
<span class="lnr"> 6191 </span>    }
<span class="lnr"> 6192 </span>});
<span class="lnr"> 6193 </span>
<span class="lnr"> 6194 </span><span class="Comment">// Implement the identical functionality for filter and not</span>
<span class="lnr"> 6195 </span><span class="Identifier">function</span> winnow( elements, qualifier, keep ) {
<span class="lnr"> 6196 </span>
<span class="lnr"> 6197 </span><span class="Comment">    // Can't pass null or undefined to indexOf in Firefox 4</span>
<span class="lnr"> 6198 </span><span class="Comment">    // Set to 0 to skip string check</span>
<span class="lnr"> 6199 </span>    qualifier = qualifier || <span class="Constant">0</span>;
<span class="lnr"> 6200 </span>
<span class="lnr"> 6201 </span>    <span class="Statement">if</span> ( jQuery.isFunction( qualifier ) ) {
<span class="lnr"> 6202 </span>       <span class="Statement">return</span> jQuery.grep(elements, <span class="Identifier">function</span>( elem, i ) {
<span class="lnr"> 6203 </span>          <span class="Type">var</span> retVal = !!qualifier.call( elem, i, elem );
<span class="lnr"> 6204 </span>          <span class="Statement">return</span> retVal === keep;
<span class="lnr"> 6205 </span>       });
<span class="lnr"> 6206 </span>
<span class="lnr"> 6207 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( qualifier.nodeType ) {
<span class="lnr"> 6208 </span>       <span class="Statement">return</span> jQuery.grep(elements, <span class="Identifier">function</span>( elem, i ) {
<span class="lnr"> 6209 </span>          <span class="Statement">return</span> ( elem === qualifier ) === keep;
<span class="lnr"> 6210 </span>       });
<span class="lnr"> 6211 </span>
<span class="lnr"> 6212 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( <span class="Statement">typeof</span> qualifier === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 6213 </span>       <span class="Type">var</span> filtered = jQuery.grep(elements, <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6214 </span>          <span class="Statement">return</span> elem.nodeType === <span class="Constant">1</span>;
<span class="lnr"> 6215 </span>       });
<span class="lnr"> 6216 </span>
<span class="lnr"> 6217 </span>       <span class="Statement">if</span> ( isSimple.test( qualifier ) ) {
<span class="lnr"> 6218 </span>          <span class="Statement">return</span> jQuery.filter(qualifier, filtered, !keep);
<span class="lnr"> 6219 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 6220 </span>          qualifier = jQuery.filter( qualifier, filtered );
<span class="lnr"> 6221 </span>       }
<span class="lnr"> 6222 </span>    }
<span class="lnr"> 6223 </span>
<span class="lnr"> 6224 </span>    <span class="Statement">return</span> jQuery.grep(elements, <span class="Identifier">function</span>( elem, i ) {
<span class="lnr"> 6225 </span>       <span class="Statement">return</span> ( jQuery.inArray( elem, qualifier ) &gt;= <span class="Constant">0</span> ) === keep;
<span class="lnr"> 6226 </span>    });
<span class="lnr"> 6227 </span>}
<span class="lnr"> 6228 </span>
<span class="lnr"> 6229 </span><span class="Comment">// 生成安全fragment</span>
<span class="lnr"> 6230 </span><span class="Identifier">function</span> createSafeFragment( document ) {
<span class="lnr"> 6231 </span>    <span class="Type">var</span> list = nodeNames.split( <span class="Constant">&quot;|&quot;</span> ),
<span class="lnr"> 6232 </span>    safeFrag = document.createDocumentFragment();
<span class="lnr"> 6233 </span>
<span class="lnr"> 6234 </span>    <span class="Statement">if</span> ( safeFrag.createElement ) {
<span class="lnr"> 6235 </span><span class="Comment">       // 使用pop()弹出数组元素,数组元素变为0时被转换为false,循环结束</span>
<span class="lnr"> 6236 </span>       <span class="Statement">while</span> ( list.length ) {
<span class="lnr"> 6237 </span>          safeFrag.createElement(
<span class="lnr"> 6238 </span>             list.pop()
<span class="lnr"> 6239 </span>          );
<span class="lnr"> 6240 </span>       }
<span class="lnr"> 6241 </span>    }
<span class="lnr"> 6242 </span>    <span class="Statement">return</span> safeFrag;
<span class="lnr"> 6243 </span>}
<span class="lnr"> 6244 </span>
<span class="lnr"> 6245 </span><span class="Type">var</span> nodeNames = <span class="Constant">&quot;abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|&quot;</span> +
<span class="lnr"> 6246 </span>       <span class="Constant">&quot;header|hgroup|mark|meter|nav|output|progress|section|summary|time|video&quot;</span>,
<span class="lnr"> 6247 </span>    rinlinejQuery = <span class="Constant">/ jQuery</span><span class="Special">\d</span><span class="Constant">+=&quot;(?:null|</span><span class="Special">\d</span><span class="Constant">+)&quot;/g</span>,
<span class="lnr"> 6248 </span>    rleadingWhitespace = <span class="Constant">/^</span><span class="Special">\s</span><span class="Constant">+/</span>,
<span class="lnr"> 6249 </span>    rxhtmlTag = <span class="Constant">/&lt;(?!area|br|col|embed|hr|img|input|link|meta|param)(([</span><span class="Special">\w</span><span class="Constant">:]+)[^&gt;]*)</span><span class="Special">\/</span><span class="Constant">&gt;/gi</span>,
<span class="lnr"> 6250 </span>    rtagName = <span class="Constant">/&lt;([</span><span class="Special">\w</span><span class="Constant">:]+)/</span>,
<span class="lnr"> 6251 </span>    rtbody = <span class="Constant">/&lt;tbody/i</span>,
<span class="lnr"> 6252 </span>    rhtml = <span class="Constant">/&lt;|&amp;#?</span><span class="Special">\w</span><span class="Constant">+;/</span>,
<span class="lnr"> 6253 </span>    rnoInnerhtml = <span class="Constant">/&lt;(?:script|style|link)/i</span>,
<span class="lnr"> 6254 </span>    rnocache = <span class="Constant">/&lt;(?:script|object|embed|option|style)/i</span>,
<span class="lnr"> 6255 </span>    rnoshimcache = <span class="Statement">new</span> <span class="Special">RegExp</span>(<span class="Constant">&quot;&lt;(?:&quot;</span> + nodeNames + <span class="Constant">&quot;)[</span><span class="Special">\\</span><span class="Constant">s/&gt;]&quot;</span>, <span class="Constant">&quot;i&quot;</span>),
<span class="lnr"> 6256 </span>    rcheckableType = <span class="Constant">/^(?:checkbox|radio)$/</span>,
<span class="lnr"> 6257 </span><span class="Comment">    // checked=&quot;checked&quot; or checked</span>
<span class="lnr"> 6258 </span>    rchecked = <span class="Constant">/checked</span><span class="Special">\s</span><span class="Constant">*(?:[^=]|=</span><span class="Special">\s</span><span class="Constant">*.checked.)/i</span>,
<span class="lnr"> 6259 </span>    rscriptType = <span class="Constant">/</span><span class="Special">\/</span><span class="Constant">(java|ecma)script/i</span>,
<span class="lnr"> 6260 </span>    rcleanScript = <span class="Constant">/^</span><span class="Special">\s</span><span class="Constant">*&lt;!(?:</span><span class="Special">\[</span><span class="Constant">CDATA</span><span class="Special">\[</span><span class="Constant">|</span><span class="Special">\-\-</span><span class="Constant">)|[</span><span class="Special">\]\-</span><span class="Constant">]{2}&gt;</span><span class="Special">\s</span><span class="Constant">*$/g</span>,
<span class="lnr"> 6261 </span>    wrapMap = {
<span class="lnr"> 6262 </span>       <span class="Statement">option</span>: [ <span class="Constant">1</span>, <span class="Constant">&quot;&lt;select multiple='multiple'&gt;&quot;</span>, <span class="Constant">&quot;&lt;/select&gt;&quot;</span> ],
<span class="lnr"> 6263 </span>       <span class="Statement">legend</span>: [ <span class="Constant">1</span>, <span class="Constant">&quot;&lt;fieldset&gt;&quot;</span>, <span class="Constant">&quot;&lt;/fieldset&gt;&quot;</span> ],
<span class="lnr"> 6264 </span>       <span class="Statement">thead</span>: [ <span class="Constant">1</span>, <span class="Constant">&quot;&lt;table&gt;&quot;</span>, <span class="Constant">&quot;&lt;/table&gt;&quot;</span> ],
<span class="lnr"> 6265 </span>       <span class="Statement">tr</span>: [ <span class="Constant">2</span>, <span class="Constant">&quot;&lt;table&gt;&lt;tbody&gt;&quot;</span>, <span class="Constant">&quot;&lt;/tbody&gt;&lt;/table&gt;&quot;</span> ],
<span class="lnr"> 6266 </span>       <span class="Statement">td</span>: [ <span class="Constant">3</span>, <span class="Constant">&quot;&lt;table&gt;&lt;tbody&gt;&lt;tr&gt;&quot;</span>, <span class="Constant">&quot;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&quot;</span> ],
<span class="lnr"> 6267 </span>       <span class="Statement">col</span>: [ <span class="Constant">2</span>, <span class="Constant">&quot;&lt;table&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;colgroup&gt;&quot;</span>, <span class="Constant">&quot;&lt;/colgroup&gt;&lt;/table&gt;&quot;</span> ],
<span class="lnr"> 6268 </span>       <span class="Statement">area</span>: [ <span class="Constant">1</span>, <span class="Constant">&quot;&lt;map&gt;&quot;</span>, <span class="Constant">&quot;&lt;/map&gt;&quot;</span> ],
<span class="lnr"> 6269 </span>       <span class="Statement">_default</span>: [ <span class="Constant">0</span>, <span class="Constant">&quot;&quot;</span>, <span class="Constant">&quot;&quot;</span> ]
<span class="lnr"> 6270 </span>    },
<span class="lnr"> 6271 </span>    safeFragment = createSafeFragment( document ),
<span class="lnr"> 6272 </span>    fragmentDiv = safeFragment.appendChild( document.createElement(<span class="Constant">&quot;div&quot;</span>) );
<span class="lnr"> 6273 </span>
<span class="lnr"> 6274 </span>wrapMap.optgroup = wrapMap.option;
<span class="lnr"> 6275 </span>wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
<span class="lnr"> 6276 </span>wrapMap.th = wrapMap.td;
<span class="lnr"> 6277 </span>
<span class="lnr"> 6278 </span><span class="Comment">// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,</span>
<span class="lnr"> 6279 </span><span class="Comment">// unless wrapped in a div with non-breaking characters in front of it.</span>
<span class="lnr"> 6280 </span><span class="Statement">if</span> ( !jQuery.support.htmlSerialize ) {
<span class="lnr"> 6281 </span>    wrapMap._default = [ <span class="Constant">1</span>, <span class="Constant">&quot;X&lt;div&gt;&quot;</span>, <span class="Constant">&quot;&lt;/div&gt;&quot;</span> ];
<span class="lnr"> 6282 </span>}
<span class="lnr"> 6283 </span>
<span class="lnr"> 6284 </span>jQuery.fn.extend({
<span class="lnr"> 6285 </span>    <span class="Statement">text</span>: <span class="Identifier">function</span>( value ) {
<span class="lnr"> 6286 </span>       <span class="Statement">return</span> jQuery.access( <span class="Type">this</span>, <span class="Identifier">function</span>( value ) {
<span class="lnr"> 6287 </span>          <span class="Statement">return</span> value === <span class="Type">undefined</span> ?
<span class="lnr"> 6288 </span>             jQuery.text( <span class="Type">this</span> ) :
<span class="lnr"> 6289 </span>             <span class="Type">this</span>.empty().append( ( <span class="Type">this</span>[<span class="Constant">0</span>] &amp;&amp; <span class="Type">this</span>[<span class="Constant">0</span>].ownerDocument || document ).createTextNode( value ) );
<span class="lnr"> 6290 </span>       }, <span class="Type">null</span>, value, arguments.length );
<span class="lnr"> 6291 </span>    },
<span class="lnr"> 6292 </span>
<span class="lnr"> 6293 </span>    <span class="Statement">wrapAll</span>: <span class="Identifier">function</span>( html ) {
<span class="lnr"> 6294 </span>       <span class="Statement">if</span> ( jQuery.isFunction( html ) ) {
<span class="lnr"> 6295 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>(i) {
<span class="lnr"> 6296 </span>             jQuery(<span class="Type">this</span>).wrapAll( html.call(<span class="Type">this</span>, i) );
<span class="lnr"> 6297 </span>          });
<span class="lnr"> 6298 </span>       }
<span class="lnr"> 6299 </span>
<span class="lnr"> 6300 </span>       <span class="Statement">if</span> ( <span class="Type">this</span>[<span class="Constant">0</span>] ) {
<span class="lnr"> 6301 </span><span class="Comment">          // The elements to wrap the target around</span>
<span class="lnr"> 6302 </span>          <span class="Type">var</span> wrap = jQuery( html, <span class="Type">this</span>[<span class="Constant">0</span>].ownerDocument ).eq(<span class="Constant">0</span>).clone(<span class="Constant">true</span>);
<span class="lnr"> 6303 </span>
<span class="lnr"> 6304 </span>          <span class="Statement">if</span> ( <span class="Type">this</span>[<span class="Constant">0</span>].parentNode ) {
<span class="lnr"> 6305 </span>             wrap.insertBefore( <span class="Type">this</span>[<span class="Constant">0</span>] );
<span class="lnr"> 6306 </span>          }
<span class="lnr"> 6307 </span>
<span class="lnr"> 6308 </span>          wrap.map(<span class="Identifier">function</span>() {
<span class="lnr"> 6309 </span>             <span class="Type">var</span> elem = <span class="Type">this</span>;
<span class="lnr"> 6310 </span>
<span class="lnr"> 6311 </span>             <span class="Statement">while</span> ( elem.firstChild &amp;&amp; elem.firstChild.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 6312 </span>                elem = elem.firstChild;
<span class="lnr"> 6313 </span>             }
<span class="lnr"> 6314 </span>
<span class="lnr"> 6315 </span>             <span class="Statement">return</span> elem;
<span class="lnr"> 6316 </span>          }).append( <span class="Type">this</span> );
<span class="lnr"> 6317 </span>       }
<span class="lnr"> 6318 </span>
<span class="lnr"> 6319 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 6320 </span>    },
<span class="lnr"> 6321 </span>
<span class="lnr"> 6322 </span>    <span class="Statement">wrapInner</span>: <span class="Identifier">function</span>( html ) {
<span class="lnr"> 6323 </span>       <span class="Statement">if</span> ( jQuery.isFunction( html ) ) {
<span class="lnr"> 6324 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>(i) {
<span class="lnr"> 6325 </span>             jQuery(<span class="Type">this</span>).wrapInner( html.call(<span class="Type">this</span>, i) );
<span class="lnr"> 6326 </span>          });
<span class="lnr"> 6327 </span>       }
<span class="lnr"> 6328 </span>
<span class="lnr"> 6329 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 6330 </span>          <span class="Type">var</span> self = jQuery( <span class="Type">this</span> ),
<span class="lnr"> 6331 </span>             contents = self.contents();
<span class="lnr"> 6332 </span>
<span class="lnr"> 6333 </span>          <span class="Statement">if</span> ( contents.length ) {
<span class="lnr"> 6334 </span>             contents.wrapAll( html );
<span class="lnr"> 6335 </span>
<span class="lnr"> 6336 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 6337 </span>             self.append( html );
<span class="lnr"> 6338 </span>          }
<span class="lnr"> 6339 </span>       });
<span class="lnr"> 6340 </span>    },
<span class="lnr"> 6341 </span>
<span class="lnr"> 6342 </span>    <span class="Statement">wrap</span>: <span class="Identifier">function</span>( html ) {
<span class="lnr"> 6343 </span>       <span class="Type">var</span> isFunction = jQuery.isFunction( html );
<span class="lnr"> 6344 </span>
<span class="lnr"> 6345 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>(i) {
<span class="lnr"> 6346 </span>          jQuery( <span class="Type">this</span> ).wrapAll( isFunction ? html.call(<span class="Type">this</span>, i) : html );
<span class="lnr"> 6347 </span>       });
<span class="lnr"> 6348 </span>    },
<span class="lnr"> 6349 </span>
<span class="lnr"> 6350 </span>    <span class="Statement">unwrap</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 6351 </span>       <span class="Statement">return</span> <span class="Type">this</span>.parent().each(<span class="Identifier">function</span>() {
<span class="lnr"> 6352 </span>          <span class="Statement">if</span> ( !jQuery.nodeName( <span class="Type">this</span>, <span class="Constant">&quot;body&quot;</span> ) ) {
<span class="lnr"> 6353 </span>             jQuery( <span class="Type">this</span> ).replaceWith( <span class="Type">this</span>.childNodes );
<span class="lnr"> 6354 </span>          }
<span class="lnr"> 6355 </span>       }).end();
<span class="lnr"> 6356 </span>    },
<span class="lnr"> 6357 </span>
<span class="lnr"> 6358 </span>    <span class="Statement">append</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 6359 </span>       <span class="Statement">return</span> <span class="Type">this</span>.domManip(arguments, <span class="Constant">true</span>, <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6360 </span>          <span class="Statement">if</span> ( <span class="Type">this</span>.nodeType === <span class="Constant">1</span> || <span class="Type">this</span>.nodeType === <span class="Constant">11</span> ) {
<span class="lnr"> 6361 </span>             <span class="Type">this</span>.appendChild( elem );
<span class="lnr"> 6362 </span>          }
<span class="lnr"> 6363 </span>       });
<span class="lnr"> 6364 </span>    },
<span class="lnr"> 6365 </span>
<span class="lnr"> 6366 </span>    <span class="Statement">prepend</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 6367 </span>       <span class="Statement">return</span> <span class="Type">this</span>.domManip(arguments, <span class="Constant">true</span>, <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6368 </span>          <span class="Statement">if</span> ( <span class="Type">this</span>.nodeType === <span class="Constant">1</span> || <span class="Type">this</span>.nodeType === <span class="Constant">11</span> ) {
<span class="lnr"> 6369 </span>             <span class="Type">this</span>.insertBefore( elem, <span class="Type">this</span>.firstChild );
<span class="lnr"> 6370 </span>          }
<span class="lnr"> 6371 </span>       });
<span class="lnr"> 6372 </span>    },
<span class="lnr"> 6373 </span>
<span class="lnr"> 6374 </span>    <span class="Statement">before</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 6375 </span>       <span class="Statement">if</span> ( !isDisconnected( <span class="Type">this</span>[<span class="Constant">0</span>] ) ) {
<span class="lnr"> 6376 </span>          <span class="Statement">return</span> <span class="Type">this</span>.domManip(arguments, <span class="Constant">false</span>, <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6377 </span>             <span class="Type">this</span>.parentNode.insertBefore( elem, <span class="Type">this</span> );
<span class="lnr"> 6378 </span>          });
<span class="lnr"> 6379 </span>       }
<span class="lnr"> 6380 </span>
<span class="lnr"> 6381 </span>       <span class="Statement">if</span> ( arguments.length ) {
<span class="lnr"> 6382 </span>          <span class="Type">var</span> set = jQuery.clean( arguments );
<span class="lnr"> 6383 </span>          <span class="Statement">return</span> <span class="Type">this</span>.pushStack( jQuery.merge( set, <span class="Type">this</span> ), <span class="Constant">&quot;before&quot;</span>, <span class="Type">this</span>.selector );
<span class="lnr"> 6384 </span>       }
<span class="lnr"> 6385 </span>    },
<span class="lnr"> 6386 </span>
<span class="lnr"> 6387 </span>    <span class="Statement">after</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 6388 </span>       <span class="Statement">if</span> ( !isDisconnected( <span class="Type">this</span>[<span class="Constant">0</span>] ) ) {
<span class="lnr"> 6389 </span>          <span class="Statement">return</span> <span class="Type">this</span>.domManip(arguments, <span class="Constant">false</span>, <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 6390 </span>             <span class="Type">this</span>.parentNode.insertBefore( elem, <span class="Type">this</span>.nextSibling );
<span class="lnr"> 6391 </span>          });
<span class="lnr"> 6392 </span>       }
<span class="lnr"> 6393 </span>
<span class="lnr"> 6394 </span>       <span class="Statement">if</span> ( arguments.length ) {
<span class="lnr"> 6395 </span>          <span class="Type">var</span> set = jQuery.clean( arguments );
<span class="lnr"> 6396 </span>          <span class="Statement">return</span> <span class="Type">this</span>.pushStack( jQuery.merge( <span class="Type">this</span>, set ), <span class="Constant">&quot;after&quot;</span>, <span class="Type">this</span>.selector );
<span class="lnr"> 6397 </span>       }
<span class="lnr"> 6398 </span>    },
<span class="lnr"> 6399 </span>
<span class="lnr"> 6400 </span><span class="Comment">    // keepData is for internal use only--do not document</span>
<span class="lnr"> 6401 </span>    <span class="Statement">remove</span>: <span class="Identifier">function</span>( selector, keepData ) {
<span class="lnr"> 6402 </span>       <span class="Type">var</span> elem,
<span class="lnr"> 6403 </span>          i = <span class="Constant">0</span>;
<span class="lnr"> 6404 </span>
<span class="lnr"> 6405 </span>       <span class="Statement">for</span> ( ; (elem = <span class="Type">this</span>[i]) != <span class="Type">null</span>; i++ ) {
<span class="lnr"> 6406 </span>          <span class="Statement">if</span> ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
<span class="lnr"> 6407 </span>             <span class="Statement">if</span> ( !keepData &amp;&amp; elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 6408 </span>                jQuery.cleanData( elem.getElementsByTagName(<span class="Constant">&quot;*&quot;</span>) );
<span class="lnr"> 6409 </span>                jQuery.cleanData( [ elem ] );
<span class="lnr"> 6410 </span>             }
<span class="lnr"> 6411 </span>
<span class="lnr"> 6412 </span>             <span class="Statement">if</span> ( elem.parentNode ) {
<span class="lnr"> 6413 </span>                elem.parentNode.removeChild( elem );
<span class="lnr"> 6414 </span>             }
<span class="lnr"> 6415 </span>          }
<span class="lnr"> 6416 </span>       }
<span class="lnr"> 6417 </span>
<span class="lnr"> 6418 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 6419 </span>    },
<span class="lnr"> 6420 </span>
<span class="lnr"> 6421 </span>    <span class="Statement">empty</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 6422 </span>       <span class="Type">var</span> elem,
<span class="lnr"> 6423 </span>          i = <span class="Constant">0</span>;
<span class="lnr"> 6424 </span>
<span class="lnr"> 6425 </span>       <span class="Statement">for</span> ( ; (elem = <span class="Type">this</span>[i]) != <span class="Type">null</span>; i++ ) {
<span class="lnr"> 6426 </span><span class="Comment">          // Remove element nodes and prevent memory leaks</span>
<span class="lnr"> 6427 </span>          <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 6428 </span>             jQuery.cleanData( elem.getElementsByTagName(<span class="Constant">&quot;*&quot;</span>) );
<span class="lnr"> 6429 </span>          }
<span class="lnr"> 6430 </span>
<span class="lnr"> 6431 </span><span class="Comment">          // Remove any remaining nodes</span>
<span class="lnr"> 6432 </span>          <span class="Statement">while</span> ( elem.firstChild ) {
<span class="lnr"> 6433 </span>             elem.removeChild( elem.firstChild );
<span class="lnr"> 6434 </span>          }
<span class="lnr"> 6435 </span>       }
<span class="lnr"> 6436 </span>
<span class="lnr"> 6437 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 6438 </span>    },
<span class="lnr"> 6439 </span>
<span class="lnr"> 6440 </span>    <span class="Statement">clone</span>: <span class="Identifier">function</span>( dataAndEvents, deepDataAndEvents ) {
<span class="lnr"> 6441 </span>       dataAndEvents = dataAndEvents == <span class="Type">null</span> ? <span class="Constant">false</span> : dataAndEvents;
<span class="lnr"> 6442 </span>       deepDataAndEvents = deepDataAndEvents == <span class="Type">null</span> ? dataAndEvents : deepDataAndEvents;
<span class="lnr"> 6443 </span>
<span class="lnr"> 6444 </span>       <span class="Statement">return</span> <span class="Type">this</span>.map( <span class="Identifier">function</span> () {
<span class="lnr"> 6445 </span>          <span class="Statement">return</span> jQuery.clone( <span class="Type">this</span>, dataAndEvents, deepDataAndEvents );
<span class="lnr"> 6446 </span>       });
<span class="lnr"> 6447 </span>    },
<span class="lnr"> 6448 </span>
<span class="lnr"> 6449 </span>    <span class="Statement">html</span>: <span class="Identifier">function</span>( value ) {
<span class="lnr"> 6450 </span>       <span class="Statement">return</span> jQuery.access( <span class="Type">this</span>, <span class="Identifier">function</span>( value ) {
<span class="lnr"> 6451 </span>          <span class="Type">var</span> elem = <span class="Type">this</span>[<span class="Constant">0</span>] || {},
<span class="lnr"> 6452 </span>             i = <span class="Constant">0</span>,
<span class="lnr"> 6453 </span>             l = <span class="Type">this</span>.length;
<span class="lnr"> 6454 </span>
<span class="lnr"> 6455 </span>          <span class="Statement">if</span> ( value === <span class="Type">undefined</span> ) {
<span class="lnr"> 6456 </span>             <span class="Statement">return</span> elem.nodeType === <span class="Constant">1</span> ?
<span class="lnr"> 6457 </span>                elem.innerHTML.replace( rinlinejQuery, <span class="Constant">&quot;&quot;</span> ) :
<span class="lnr"> 6458 </span>                <span class="Type">undefined</span>;
<span class="lnr"> 6459 </span>          }
<span class="lnr"> 6460 </span>
<span class="lnr"> 6461 </span><span class="Comment">          // See if we can take a shortcut and just use innerHTML</span>
<span class="lnr"> 6462 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> value === <span class="Constant">&quot;string&quot;</span> &amp;&amp; !rnoInnerhtml.test( value ) &amp;&amp;
<span class="lnr"> 6463 </span>             ( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &amp;&amp;
<span class="lnr"> 6464 </span>             ( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &amp;&amp;
<span class="lnr"> 6465 </span>             !wrapMap[ ( rtagName.exec( value ) || [<span class="Constant">&quot;&quot;</span>, <span class="Constant">&quot;&quot;</span>] )[<span class="Constant">1</span>].toLowerCase() ] ) {
<span class="lnr"> 6466 </span>
<span class="lnr"> 6467 </span>             value = value.replace( rxhtmlTag, <span class="Constant">&quot;&lt;$1&gt;&lt;/$2&gt;&quot;</span> );
<span class="lnr"> 6468 </span>
<span class="lnr"> 6469 </span>             <span class="Statement">try</span> {
<span class="lnr"> 6470 </span>                <span class="Statement">for</span> (; i &lt; l; i++ ) {
<span class="lnr"> 6471 </span><span class="Comment">                   // Remove element nodes and prevent memory leaks</span>
<span class="lnr"> 6472 </span>                   elem = <span class="Type">this</span>[i] || {};
<span class="lnr"> 6473 </span>                   <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> ) {
<span class="lnr"> 6474 </span>                      jQuery.cleanData( elem.getElementsByTagName( <span class="Constant">&quot;*&quot;</span> ) );
<span class="lnr"> 6475 </span>                      elem.innerHTML = value;
<span class="lnr"> 6476 </span>                   }
<span class="lnr"> 6477 </span>                }
<span class="lnr"> 6478 </span>
<span class="lnr"> 6479 </span>                elem = <span class="Constant">0</span>;
<span class="lnr"> 6480 </span>
<span class="lnr"> 6481 </span><span class="Comment">             // If using innerHTML throws an exception, use the fallback method</span>
<span class="lnr"> 6482 </span>             } <span class="Statement">catch</span>(e) {}
<span class="lnr"> 6483 </span>          }
<span class="lnr"> 6484 </span>
<span class="lnr"> 6485 </span>          <span class="Statement">if</span> ( elem ) {
<span class="lnr"> 6486 </span>             <span class="Type">this</span>.empty().append( value );
<span class="lnr"> 6487 </span>          }
<span class="lnr"> 6488 </span>       }, <span class="Type">null</span>, value, arguments.length );
<span class="lnr"> 6489 </span>    },
<span class="lnr"> 6490 </span>
<span class="lnr"> 6491 </span>    <span class="Statement">replaceWith</span>: <span class="Identifier">function</span>( value ) {
<span class="lnr"> 6492 </span>       <span class="Statement">if</span> ( !isDisconnected( <span class="Type">this</span>[<span class="Constant">0</span>] ) ) {
<span class="lnr"> 6493 </span><span class="Comment">          // Make sure that the elements are removed from the DOM before they are inserted</span>
<span class="lnr"> 6494 </span><span class="Comment">          // this can help fix replacing a parent with child elements</span>
<span class="lnr"> 6495 </span>          <span class="Statement">if</span> ( jQuery.isFunction( value ) ) {
<span class="lnr"> 6496 </span>             <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>(i) {
<span class="lnr"> 6497 </span>                <span class="Type">var</span> self = jQuery(<span class="Type">this</span>), old = self.html();
<span class="lnr"> 6498 </span>                self.replaceWith( value.call( <span class="Type">this</span>, i, old ) );
<span class="lnr"> 6499 </span>             });
<span class="lnr"> 6500 </span>          }
<span class="lnr"> 6501 </span>
<span class="lnr"> 6502 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> value !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 6503 </span>             value = jQuery( value ).detach();
<span class="lnr"> 6504 </span>          }
<span class="lnr"> 6505 </span>
<span class="lnr"> 6506 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 6507 </span>             <span class="Type">var</span> next = <span class="Type">this</span>.nextSibling,
<span class="lnr"> 6508 </span>                parent = <span class="Type">this</span>.parentNode;
<span class="lnr"> 6509 </span>
<span class="lnr"> 6510 </span>             jQuery( <span class="Type">this</span> ).remove();
<span class="lnr"> 6511 </span>
<span class="lnr"> 6512 </span>             <span class="Statement">if</span> ( next ) {
<span class="lnr"> 6513 </span>                jQuery(next).before( value );
<span class="lnr"> 6514 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 6515 </span>                jQuery(parent).append( value );
<span class="lnr"> 6516 </span>             }
<span class="lnr"> 6517 </span>          });
<span class="lnr"> 6518 </span>       }
<span class="lnr"> 6519 </span>
<span class="lnr"> 6520 </span>       <span class="Statement">return</span> <span class="Type">this</span>.length ?
<span class="lnr"> 6521 </span>          <span class="Type">this</span>.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), <span class="Constant">&quot;replaceWith&quot;</span>, value ) :
<span class="lnr"> 6522 </span>          <span class="Type">this</span>;
<span class="lnr"> 6523 </span>    },
<span class="lnr"> 6524 </span>
<span class="lnr"> 6525 </span>    <span class="Statement">detach</span>: <span class="Identifier">function</span>( selector ) {
<span class="lnr"> 6526 </span>       <span class="Statement">return</span> <span class="Type">this</span>.remove( selector, <span class="Constant">true</span> );
<span class="lnr"> 6527 </span>    },
<span class="lnr"> 6528 </span>
<span class="lnr"> 6529 </span>    <span class="Statement">domManip</span>: <span class="Identifier">function</span>( args, table, callback ) {
<span class="lnr"> 6530 </span>
<span class="lnr"> 6531 </span><span class="Comment">       // Flatten any nested arrays</span>
<span class="lnr"> 6532 </span>       args = [].concat.apply( [], args );
<span class="lnr"> 6533 </span>
<span class="lnr"> 6534 </span>       <span class="Type">var</span> results, first, fragment, iNoClone,
<span class="lnr"> 6535 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 6536 </span>          value = args[<span class="Constant">0</span>],
<span class="lnr"> 6537 </span>          scripts = [],
<span class="lnr"> 6538 </span>          l = <span class="Type">this</span>.length;
<span class="lnr"> 6539 </span>
<span class="lnr"> 6540 </span><span class="Comment">       // We can't cloneNode fragments that contain checked, in WebKit</span>
<span class="lnr"> 6541 </span>       <span class="Statement">if</span> ( !jQuery.support.checkClone &amp;&amp; l &gt; <span class="Constant">1</span> &amp;&amp; <span class="Statement">typeof</span> value === <span class="Constant">&quot;string&quot;</span> &amp;&amp; rchecked.test( value ) ) {
<span class="lnr"> 6542 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 6543 </span>             jQuery(<span class="Type">this</span>).domManip( args, table, callback );
<span class="lnr"> 6544 </span>          });
<span class="lnr"> 6545 </span>       }
<span class="lnr"> 6546 </span>
<span class="lnr"> 6547 </span>       <span class="Statement">if</span> ( jQuery.isFunction(value) ) {
<span class="lnr"> 6548 </span>          <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>(i) {
<span class="lnr"> 6549 </span>             <span class="Type">var</span> self = jQuery(<span class="Type">this</span>);
<span class="lnr"> 6550 </span>             args[<span class="Constant">0</span>] = value.call( <span class="Type">this</span>, i, table ? self.html() : <span class="Type">undefined</span> );
<span class="lnr"> 6551 </span>             self.domManip( args, table, callback );
<span class="lnr"> 6552 </span>          });
<span class="lnr"> 6553 </span>       }
<span class="lnr"> 6554 </span>
<span class="lnr"> 6555 </span>       <span class="Statement">if</span> ( <span class="Type">this</span>[<span class="Constant">0</span>] ) {
<span class="lnr"> 6556 </span>          results = jQuery.buildFragment( args, <span class="Type">this</span>, scripts );
<span class="lnr"> 6557 </span>          fragment = results.fragment;
<span class="lnr"> 6558 </span>          first = fragment.firstChild;
<span class="lnr"> 6559 </span>
<span class="lnr"> 6560 </span>          <span class="Statement">if</span> ( fragment.childNodes.length === <span class="Constant">1</span> ) {
<span class="lnr"> 6561 </span>             fragment = first;
<span class="lnr"> 6562 </span>          }
<span class="lnr"> 6563 </span>
<span class="lnr"> 6564 </span>          <span class="Statement">if</span> ( first ) {
<span class="lnr"> 6565 </span>             table = table &amp;&amp; jQuery.nodeName( first, <span class="Constant">&quot;tr&quot;</span> );
<span class="lnr"> 6566 </span>
<span class="lnr"> 6567 </span><span class="Comment">             // Use the original fragment for the last item instead of the first because it can end up</span>
<span class="lnr"> 6568 </span><span class="Comment">             // being emptied incorrectly in certain situations (#8070).</span>
<span class="lnr"> 6569 </span><span class="Comment">             // Fragments from the fragment cache must always be cloned and never used in place.</span>
<span class="lnr"> 6570 </span>             <span class="Statement">for</span> ( iNoClone = results.cacheable || l - <span class="Constant">1</span>; i &lt; l; i++ ) {
<span class="lnr"> 6571 </span>                callback.call(
<span class="lnr"> 6572 </span>                   table &amp;&amp; jQuery.nodeName( <span class="Type">this</span>[i], <span class="Constant">&quot;table&quot;</span> ) ?
<span class="lnr"> 6573 </span>                      findOrAppend( <span class="Type">this</span>[i], <span class="Constant">&quot;tbody&quot;</span> ) :
<span class="lnr"> 6574 </span>                      <span class="Type">this</span>[i],
<span class="lnr"> 6575 </span>                   i === iNoClone ?
<span class="lnr"> 6576 </span>                      <span class="Statement">fragment</span> :
<span class="lnr"> 6577 </span>                      jQuery.clone( fragment, <span class="Constant">true</span>, <span class="Constant">true</span> )
<span class="lnr"> 6578 </span>                );
<span class="lnr"> 6579 </span>             }
<span class="lnr"> 6580 </span>          }
<span class="lnr"> 6581 </span>
<span class="lnr"> 6582 </span><span class="Comment">          // Fix #11809: Avoid leaking memory</span>
<span class="lnr"> 6583 </span>          fragment = first = <span class="Type">null</span>;
<span class="lnr"> 6584 </span>
<span class="lnr"> 6585 </span>          <span class="Statement">if</span> ( scripts.length ) {
<span class="lnr"> 6586 </span>             jQuery.each( scripts, <span class="Identifier">function</span>( i, elem ) {
<span class="lnr"> 6587 </span>                <span class="Statement">if</span> ( elem.src ) {
<span class="lnr"> 6588 </span>                   <span class="Statement">if</span> ( jQuery.ajax ) {
<span class="lnr"> 6589 </span>                      jQuery.ajax({
<span class="lnr"> 6590 </span>                         <span class="Statement">url</span>: elem.src,
<span class="lnr"> 6591 </span>                         <span class="Statement">type</span>: <span class="Constant">&quot;GET&quot;</span>,
<span class="lnr"> 6592 </span>                         <span class="Statement">dataType</span>: <span class="Constant">&quot;script&quot;</span>,
<span class="lnr"> 6593 </span>                         <span class="Statement">async</span>: <span class="Constant">false</span>,
<span class="lnr"> 6594 </span>                         <span class="Statement">global</span>: <span class="Constant">false</span>,
<span class="lnr"> 6595 </span>                         <span class="Constant">&quot;throws&quot;</span>: <span class="Constant">true</span>
<span class="lnr"> 6596 </span>                      });
<span class="lnr"> 6597 </span>                   } <span class="Statement">else</span> {
<span class="lnr"> 6598 </span>                      jQuery.error(<span class="Constant">&quot;no ajax&quot;</span>);
<span class="lnr"> 6599 </span>                   }
<span class="lnr"> 6600 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 6601 </span>                   jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || <span class="Constant">&quot;&quot;</span> ).replace( rcleanScript, <span class="Constant">&quot;&quot;</span> ) );
<span class="lnr"> 6602 </span>                }
<span class="lnr"> 6603 </span>
<span class="lnr"> 6604 </span>                <span class="Statement">if</span> ( elem.parentNode ) {
<span class="lnr"> 6605 </span>                   elem.parentNode.removeChild( elem );
<span class="lnr"> 6606 </span>                }
<span class="lnr"> 6607 </span>             });
<span class="lnr"> 6608 </span>          }
<span class="lnr"> 6609 </span>       }
<span class="lnr"> 6610 </span>
<span class="lnr"> 6611 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 6612 </span>    }
<span class="lnr"> 6613 </span>});
<span class="lnr"> 6614 </span>
<span class="lnr"> 6615 </span><span class="Identifier">function</span> findOrAppend( elem, tag ) {
<span class="lnr"> 6616 </span>    <span class="Statement">return</span> elem.getElementsByTagName( tag )[<span class="Constant">0</span>] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
<span class="lnr"> 6617 </span>}
<span class="lnr"> 6618 </span>
<span class="lnr"> 6619 </span><span class="Identifier">function</span> cloneCopyEvent( src, dest ) {
<span class="lnr"> 6620 </span>
<span class="lnr"> 6621 </span>    <span class="Statement">if</span> ( dest.nodeType !== <span class="Constant">1</span> || !jQuery.hasData( src ) ) {
<span class="lnr"> 6622 </span>       <span class="Statement">return</span>;
<span class="lnr"> 6623 </span>    }
<span class="lnr"> 6624 </span>
<span class="lnr"> 6625 </span>    <span class="Type">var</span> type, i, l,
<span class="lnr"> 6626 </span>       oldData = jQuery._data( src ),
<span class="lnr"> 6627 </span>       curData = jQuery._data( dest, oldData ),
<span class="lnr"> 6628 </span>       events = oldData.events;
<span class="lnr"> 6629 </span>
<span class="lnr"> 6630 </span>    <span class="Statement">if</span> ( events ) {
<span class="lnr"> 6631 </span>       <span class="Statement">delete</span> curData.handle;
<span class="lnr"> 6632 </span>       curData.events = {};
<span class="lnr"> 6633 </span>
<span class="lnr"> 6634 </span>       <span class="Statement">for</span> ( type <span class="Statement">in</span> events ) {
<span class="lnr"> 6635 </span>          <span class="Statement">for</span> ( i = <span class="Constant">0</span>, l = events[ type ].length; i &lt; l; i++ ) {
<span class="lnr"> 6636 </span>             jQuery.event.add( dest, type, events[ type ][ i ] );
<span class="lnr"> 6637 </span>          }
<span class="lnr"> 6638 </span>       }
<span class="lnr"> 6639 </span>    }
<span class="lnr"> 6640 </span>
<span class="lnr"> 6641 </span><span class="Comment">    // make the cloned public data object a copy from the original</span>
<span class="lnr"> 6642 </span>    <span class="Statement">if</span> ( curData.data ) {
<span class="lnr"> 6643 </span>       curData.data = jQuery.extend( {}, curData.data );
<span class="lnr"> 6644 </span>    }
<span class="lnr"> 6645 </span>}
<span class="lnr"> 6646 </span>
<span class="lnr"> 6647 </span><span class="Identifier">function</span> cloneFixAttributes( src, dest ) {
<span class="lnr"> 6648 </span>    <span class="Type">var</span> nodeName;
<span class="lnr"> 6649 </span>
<span class="lnr"> 6650 </span><span class="Comment">    // We do not need to do anything for non-Elements</span>
<span class="lnr"> 6651 </span>    <span class="Statement">if</span> ( dest.nodeType !== <span class="Constant">1</span> ) {
<span class="lnr"> 6652 </span>       <span class="Statement">return</span>;
<span class="lnr"> 6653 </span>    }
<span class="lnr"> 6654 </span>
<span class="lnr"> 6655 </span><span class="Comment">    // clearAttributes removes the attributes, which we don't want,</span>
<span class="lnr"> 6656 </span><span class="Comment">    // but also removes the attachEvent events, which we *do* want</span>
<span class="lnr"> 6657 </span>    <span class="Statement">if</span> ( dest.clearAttributes ) {
<span class="lnr"> 6658 </span>       dest.clearAttributes();
<span class="lnr"> 6659 </span>    }
<span class="lnr"> 6660 </span>
<span class="lnr"> 6661 </span><span class="Comment">    // mergeAttributes, in contrast, only merges back on the</span>
<span class="lnr"> 6662 </span><span class="Comment">    // original attributes, not the events</span>
<span class="lnr"> 6663 </span>    <span class="Statement">if</span> ( dest.mergeAttributes ) {
<span class="lnr"> 6664 </span>       dest.mergeAttributes( src );
<span class="lnr"> 6665 </span>    }
<span class="lnr"> 6666 </span>
<span class="lnr"> 6667 </span>    nodeName = dest.nodeName.toLowerCase();
<span class="lnr"> 6668 </span>
<span class="lnr"> 6669 </span>    <span class="Statement">if</span> ( nodeName === <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 6670 </span><span class="Comment">       // IE6-10 improperly clones children of object elements using classid.</span>
<span class="lnr"> 6671 </span><span class="Comment">       // IE10 throws NoModificationAllowedError if parent is null, #12132.</span>
<span class="lnr"> 6672 </span>       <span class="Statement">if</span> ( dest.parentNode ) {
<span class="lnr"> 6673 </span>          dest.outerHTML = src.outerHTML;
<span class="lnr"> 6674 </span>       }
<span class="lnr"> 6675 </span>
<span class="lnr"> 6676 </span><span class="Comment">       // This path appears unavoidable for IE9. When cloning an object</span>
<span class="lnr"> 6677 </span><span class="Comment">       // element in IE9, the outerHTML strategy above is not sufficient.</span>
<span class="lnr"> 6678 </span><span class="Comment">       // If the src has innerHTML and the destination does not,</span>
<span class="lnr"> 6679 </span><span class="Comment">       // copy the src.innerHTML into the dest.innerHTML. #10324</span>
<span class="lnr"> 6680 </span>       <span class="Statement">if</span> ( jQuery.support.html5Clone &amp;&amp; (src.innerHTML &amp;&amp; !jQuery.trim(dest.innerHTML)) ) {
<span class="lnr"> 6681 </span>          dest.innerHTML = src.innerHTML;
<span class="lnr"> 6682 </span>       }
<span class="lnr"> 6683 </span>
<span class="lnr"> 6684 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( nodeName === <span class="Constant">&quot;input&quot;</span> &amp;&amp; rcheckableType.test( src.type ) ) {
<span class="lnr"> 6685 </span><span class="Comment">       // IE6-8 fails to persist the checked state of a cloned checkbox</span>
<span class="lnr"> 6686 </span><span class="Comment">       // or radio button. Worse, IE6-7 fail to give the cloned element</span>
<span class="lnr"> 6687 </span><span class="Comment">       // a checked appearance if the defaultChecked value isn't also set</span>
<span class="lnr"> 6688 </span>
<span class="lnr"> 6689 </span>       dest.defaultChecked = dest.checked = src.checked;
<span class="lnr"> 6690 </span>
<span class="lnr"> 6691 </span><span class="Comment">       // IE6-7 get confused and end up setting the value of a cloned</span>
<span class="lnr"> 6692 </span><span class="Comment">       // checkbox/radio button to an empty string instead of &quot;on&quot;</span>
<span class="lnr"> 6693 </span>       <span class="Statement">if</span> ( dest.value !== src.value ) {
<span class="lnr"> 6694 </span>          dest.value = src.value;
<span class="lnr"> 6695 </span>       }
<span class="lnr"> 6696 </span>
<span class="lnr"> 6697 </span><span class="Comment">    // IE6-8 fails to return the selected option to the default selected</span>
<span class="lnr"> 6698 </span><span class="Comment">    // state when cloning options</span>
<span class="lnr"> 6699 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( nodeName === <span class="Constant">&quot;option&quot;</span> ) {
<span class="lnr"> 6700 </span>       dest.selected = src.defaultSelected;
<span class="lnr"> 6701 </span>
<span class="lnr"> 6702 </span><span class="Comment">    // IE6-8 fails to set the defaultValue to the correct value when</span>
<span class="lnr"> 6703 </span><span class="Comment">    // cloning other types of input fields</span>
<span class="lnr"> 6704 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( nodeName === <span class="Constant">&quot;input&quot;</span> || nodeName === <span class="Constant">&quot;textarea&quot;</span> ) {
<span class="lnr"> 6705 </span>       dest.defaultValue = src.defaultValue;
<span class="lnr"> 6706 </span>
<span class="lnr"> 6707 </span><span class="Comment">    // IE blanks contents when cloning scripts</span>
<span class="lnr"> 6708 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( nodeName === <span class="Constant">&quot;script&quot;</span> &amp;&amp; dest.text !== src.text ) {
<span class="lnr"> 6709 </span>       dest.text = src.text;
<span class="lnr"> 6710 </span>    }
<span class="lnr"> 6711 </span>
<span class="lnr"> 6712 </span><span class="Comment">    // Event data gets referenced instead of copied if the expando</span>
<span class="lnr"> 6713 </span><span class="Comment">    // gets copied too</span>
<span class="lnr"> 6714 </span>    dest.removeAttribute( jQuery.expando );
<span class="lnr"> 6715 </span>}
<span class="lnr"> 6716 </span>
<span class="lnr"> 6717 </span>jQuery.buildFragment = <span class="Identifier">function</span>( args, context, scripts ) {
<span class="lnr"> 6718 </span>    <span class="Type">var</span> fragment, cacheable, cachehit,
<span class="lnr"> 6719 </span>       first = args[ <span class="Constant">0</span> ];
<span class="lnr"> 6720 </span>
<span class="lnr"> 6721 </span><span class="Comment">    // Set context from what may come in as undefined or a jQuery collection or a node</span>
<span class="lnr"> 6722 </span><span class="Comment">    // Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &amp;</span>
<span class="lnr"> 6723 </span><span class="Comment">    // also doubles as fix for #8950 where plain objects caused createDocumentFragment exception</span>
<span class="lnr"> 6724 </span><span class="Comment">    // 处理传入undefined的情况</span>
<span class="lnr"> 6725 </span>    context = context || document;
<span class="lnr"> 6726 </span><span class="Comment">    // 处理传入jQuery对象的情况</span>
<span class="lnr"> 6727 </span>    context = !context.nodeType &amp;&amp; context[<span class="Constant">0</span>] || context;
<span class="lnr"> 6728 </span><span class="Comment">    // 处理传入平凡对象的情况</span>
<span class="lnr"> 6729 </span>    context = context.ownerDocument || context;
<span class="lnr"> 6730 </span>
<span class="lnr"> 6731 </span><span class="Comment">    // Only cache &quot;small&quot; (1/2 KB) HTML strings that are associated with the main document</span>
<span class="lnr"> 6732 </span><span class="Comment">    // 只缓存和主文档关联的“小”(0.5KB)的HTML字符串</span>
<span class="lnr"> 6733 </span><span class="Comment">    // Cloning options loses the selected state, so don't cache them</span>
<span class="lnr"> 6734 </span><span class="Comment">    // 复制option标签将丢失选择的状态,不进行缓存</span>
<span class="lnr"> 6735 </span><span class="Comment">    // IE 6 doesn't like it when you put &lt;object&gt; or &lt;embed&gt; elements in a fragment</span>
<span class="lnr"> 6736 </span><span class="Comment">    // IE 6不支持fragment中包含&lt;object&gt; 或 &lt;embed&gt; </span>
<span class="lnr"> 6737 </span><span class="Comment">    // Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache</span>
<span class="lnr"> 6738 </span><span class="Comment">    // WebKit不克隆节点的'checked',所以不缓存</span>
<span class="lnr"> 6739 </span><span class="Comment">    // Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501</span>
<span class="lnr"> 6740 </span><span class="Comment">    // IE6,7,8不能正确重用从未知元素创建的缓存fragments</span>
<span class="lnr"> 6741 </span>    <span class="Statement">if</span> ( args.length === <span class="Constant">1</span> &amp;&amp; <span class="Statement">typeof</span> first === <span class="Constant">&quot;string&quot;</span> &amp;&amp; first.length &lt; <span class="Constant">512</span> &amp;&amp; context === document &amp;&amp;
<span class="lnr"> 6742 </span>       first.charAt(<span class="Constant">0</span>) === <span class="Constant">&quot;&lt;&quot;</span> &amp;&amp; !rnocache.test( first ) &amp;&amp;
<span class="lnr"> 6743 </span>       (jQuery.support.checkClone || !rchecked.test( first )) &amp;&amp;
<span class="lnr"> 6744 </span>       (jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
<span class="lnr"> 6745 </span>
<span class="lnr"> 6746 </span><span class="Comment">       // Mark cacheable and look for a hit</span>
<span class="lnr"> 6747 </span><span class="Comment">       // 从缓存中查找</span>
<span class="lnr"> 6748 </span>       cacheable = <span class="Constant">true</span>;
<span class="lnr"> 6749 </span>       fragment = jQuery.fragments[ first ];
<span class="lnr"> 6750 </span>       cachehit = fragment !== <span class="Type">undefined</span>;
<span class="lnr"> 6751 </span>    }
<span class="lnr"> 6752 </span>
<span class="lnr"> 6753 </span><span class="Comment">    // 未找到缓存的fragment</span>
<span class="lnr"> 6754 </span>    <span class="Statement">if</span> ( !fragment ) {
<span class="lnr"> 6755 </span><span class="Comment">       // 在context上创建一个fragment,在jQuery.clean中向其中添加dom元素</span>
<span class="lnr"> 6756 </span>       fragment = context.createDocumentFragment();
<span class="lnr"> 6757 </span>       jQuery.clean( args, context, fragment, scripts );
<span class="lnr"> 6758 </span>
<span class="lnr"> 6759 </span><span class="Comment">       // Update the cache, but only store false</span>
<span class="lnr"> 6760 </span><span class="Comment">       // unless this is a second parsing of the same content</span>
<span class="lnr"> 6761 </span><span class="Comment">       // 更新缓存,如果fragment为null或者false,则缓存为false,否则返回fragment</span>
<span class="lnr"> 6762 </span>       <span class="Statement">if</span> ( cacheable ) {
<span class="lnr"> 6763 </span>          jQuery.fragments[ first ] = cachehit &amp;&amp; fragment;
<span class="lnr"> 6764 </span>       }
<span class="lnr"> 6765 </span>    }
<span class="lnr"> 6766 </span>
<span class="lnr"> 6767 </span>    <span class="Statement">return</span> { <span class="Statement">fragment</span>: fragment, <span class="Statement">cacheable</span>: cacheable };
<span class="lnr"> 6768 </span>};
<span class="lnr"> 6769 </span>
<span class="lnr"> 6770 </span>jQuery.fragments = {};
<span class="lnr"> 6771 </span>
<span class="lnr"> 6772 </span>jQuery.each({
<span class="lnr"> 6773 </span>    <span class="Statement">appendTo</span>: <span class="Constant">&quot;append&quot;</span>,
<span class="lnr"> 6774 </span>    <span class="Statement">prependTo</span>: <span class="Constant">&quot;prepend&quot;</span>,
<span class="lnr"> 6775 </span>    <span class="Statement">insertBefore</span>: <span class="Constant">&quot;before&quot;</span>,
<span class="lnr"> 6776 </span>    <span class="Statement">insertAfter</span>: <span class="Constant">&quot;after&quot;</span>,
<span class="lnr"> 6777 </span>    <span class="Statement">replaceAll</span>: <span class="Constant">&quot;replaceWith&quot;</span>
<span class="lnr"> 6778 </span>}, <span class="Identifier">function</span>( name, original ) {
<span class="lnr"> 6779 </span>    jQuery.fn[ name ] = <span class="Identifier">function</span>( selector ) {
<span class="lnr"> 6780 </span>       <span class="Type">var</span> elems,
<span class="lnr"> 6781 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 6782 </span>          ret = [],
<span class="lnr"> 6783 </span>          insert = jQuery( selector ),
<span class="lnr"> 6784 </span>          l = insert.length,
<span class="lnr"> 6785 </span>          parent = <span class="Type">this</span>.length === <span class="Constant">1</span> &amp;&amp; <span class="Type">this</span>[<span class="Constant">0</span>].parentNode;
<span class="lnr"> 6786 </span>
<span class="lnr"> 6787 </span>       <span class="Statement">if</span> ( (parent == <span class="Type">null</span> || parent &amp;&amp; parent.nodeType === <span class="Constant">11</span> &amp;&amp; parent.childNodes.length === <span class="Constant">1</span>) &amp;&amp; l === <span class="Constant">1</span> ) {
<span class="lnr"> 6788 </span>          insert[ original ]( <span class="Type">this</span>[<span class="Constant">0</span>] );
<span class="lnr"> 6789 </span>          <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 6790 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 6791 </span>          <span class="Statement">for</span> ( ; i &lt; l; i++ ) {
<span class="lnr"> 6792 </span>             elems = ( i &gt; <span class="Constant">0</span> ? <span class="Type">this</span>.clone(<span class="Constant">true</span>) : <span class="Type">this</span> ).get();
<span class="lnr"> 6793 </span>             jQuery( insert[i] )[ original ]( elems );
<span class="lnr"> 6794 </span>             ret = ret.concat( elems );
<span class="lnr"> 6795 </span>          }
<span class="lnr"> 6796 </span>
<span class="lnr"> 6797 </span>          <span class="Statement">return</span> <span class="Type">this</span>.pushStack( ret, name, insert.selector );
<span class="lnr"> 6798 </span>       }
<span class="lnr"> 6799 </span>    };
<span class="lnr"> 6800 </span>});
<span class="lnr"> 6801 </span>
<span class="lnr"> 6802 </span><span class="Identifier">function</span> getAll( elem ) {
<span class="lnr"> 6803 </span>    <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem.getElementsByTagName !== <span class="Constant">&quot;undefined&quot;</span> ) {
<span class="lnr"> 6804 </span>       <span class="Statement">return</span> elem.getElementsByTagName( <span class="Constant">&quot;*&quot;</span> );
<span class="lnr"> 6805 </span>
<span class="lnr"> 6806 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem.querySelectorAll !== <span class="Constant">&quot;undefined&quot;</span> ) {
<span class="lnr"> 6807 </span>       <span class="Statement">return</span> elem.querySelectorAll( <span class="Constant">&quot;*&quot;</span> );
<span class="lnr"> 6808 </span>
<span class="lnr"> 6809 </span>    } <span class="Statement">else</span> {
<span class="lnr"> 6810 </span>       <span class="Statement">return</span> [];
<span class="lnr"> 6811 </span>    }
<span class="lnr"> 6812 </span>}
<span class="lnr"> 6813 </span>
<span class="lnr"> 6814 </span><span class="Comment">// Used in clean, fixes the defaultChecked property</span>
<span class="lnr"> 6815 </span><span class="Comment">// 在clean中使用,修复checkbox/radio的默认选中属性</span>
<span class="lnr"> 6816 </span><span class="Identifier">function</span> fixDefaultChecked( elem ) {
<span class="lnr"> 6817 </span>    <span class="Statement">if</span> ( rcheckableType.test( elem.type ) ) {
<span class="lnr"> 6818 </span>       elem.defaultChecked = elem.checked;
<span class="lnr"> 6819 </span>    }
<span class="lnr"> 6820 </span>}
<span class="lnr"> 6821 </span>
<span class="lnr"> 6822 </span>jQuery.extend({
<span class="lnr"> 6823 </span>    <span class="Statement">clone</span>: <span class="Identifier">function</span>( elem, dataAndEvents, deepDataAndEvents ) {
<span class="lnr"> 6824 </span>       <span class="Type">var</span> srcElements,
<span class="lnr"> 6825 </span>          destElements,
<span class="lnr"> 6826 </span>          i,
<span class="lnr"> 6827 </span>          clone;
<span class="lnr"> 6828 </span>
<span class="lnr"> 6829 </span>       <span class="Statement">if</span> ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( <span class="Constant">&quot;&lt;&quot;</span> + elem.nodeName + <span class="Constant">&quot;&gt;&quot;</span> ) ) {
<span class="lnr"> 6830 </span>          clone = elem.cloneNode( <span class="Constant">true</span> );
<span class="lnr"> 6831 </span>
<span class="lnr"> 6832 </span><span class="Comment">       // IE&lt;=8 does not properly clone detached, unknown element nodes</span>
<span class="lnr"> 6833 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 6834 </span>          fragmentDiv.innerHTML = elem.outerHTML;
<span class="lnr"> 6835 </span>          fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
<span class="lnr"> 6836 </span>       }
<span class="lnr"> 6837 </span>
<span class="lnr"> 6838 </span>       <span class="Statement">if</span> ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &amp;&amp;
<span class="lnr"> 6839 </span>             (elem.nodeType === <span class="Constant">1</span> || elem.nodeType === <span class="Constant">11</span>) &amp;&amp; !jQuery.isXMLDoc(elem) ) {
<span class="lnr"> 6840 </span><span class="Comment">          // IE copies events bound via attachEvent when using cloneNode.</span>
<span class="lnr"> 6841 </span><span class="Comment">          // Calling detachEvent on the clone will also remove the events</span>
<span class="lnr"> 6842 </span><span class="Comment">          // from the original. In order to get around this, we use some</span>
<span class="lnr"> 6843 </span><span class="Comment">          // proprietary methods to clear the events. Thanks to MooTools</span>
<span class="lnr"> 6844 </span><span class="Comment">          // guys for this hotness.</span>
<span class="lnr"> 6845 </span>
<span class="lnr"> 6846 </span>          cloneFixAttributes( elem, clone );
<span class="lnr"> 6847 </span>
<span class="lnr"> 6848 </span><span class="Comment">          // Using Sizzle here is crazy slow, so we use getElementsByTagName instead</span>
<span class="lnr"> 6849 </span>          srcElements = getAll( elem );
<span class="lnr"> 6850 </span>          destElements = getAll( clone );
<span class="lnr"> 6851 </span>
<span class="lnr"> 6852 </span><span class="Comment">          // Weird iteration because IE will replace the length property</span>
<span class="lnr"> 6853 </span><span class="Comment">          // with an element if you are cloning the body and one of the</span>
<span class="lnr"> 6854 </span><span class="Comment">          // elements on the page has a name or id of &quot;length&quot;</span>
<span class="lnr"> 6855 </span>          <span class="Statement">for</span> ( i = <span class="Constant">0</span>; srcElements[i]; ++i ) {
<span class="lnr"> 6856 </span><span class="Comment">             // Ensure that the destination node is not null; Fixes #9587</span>
<span class="lnr"> 6857 </span>             <span class="Statement">if</span> ( destElements[i] ) {
<span class="lnr"> 6858 </span>                cloneFixAttributes( srcElements[i], destElements[i] );
<span class="lnr"> 6859 </span>             }
<span class="lnr"> 6860 </span>          }
<span class="lnr"> 6861 </span>       }
<span class="lnr"> 6862 </span>
<span class="lnr"> 6863 </span><span class="Comment">       // Copy the events from the original to the clone</span>
<span class="lnr"> 6864 </span>       <span class="Statement">if</span> ( dataAndEvents ) {
<span class="lnr"> 6865 </span>          cloneCopyEvent( elem, clone );
<span class="lnr"> 6866 </span>
<span class="lnr"> 6867 </span>          <span class="Statement">if</span> ( deepDataAndEvents ) {
<span class="lnr"> 6868 </span>             srcElements = getAll( elem );
<span class="lnr"> 6869 </span>             destElements = getAll( clone );
<span class="lnr"> 6870 </span>
<span class="lnr"> 6871 </span>             <span class="Statement">for</span> ( i = <span class="Constant">0</span>; srcElements[i]; ++i ) {
<span class="lnr"> 6872 </span>                cloneCopyEvent( srcElements[i], destElements[i] );
<span class="lnr"> 6873 </span>             }
<span class="lnr"> 6874 </span>          }
<span class="lnr"> 6875 </span>       }
<span class="lnr"> 6876 </span>
<span class="lnr"> 6877 </span>       srcElements = destElements = <span class="Type">null</span>;
<span class="lnr"> 6878 </span>
<span class="lnr"> 6879 </span><span class="Comment">       // Return the cloned set</span>
<span class="lnr"> 6880 </span>       <span class="Statement">return</span> clone;
<span class="lnr"> 6881 </span>    },
<span class="lnr"> 6882 </span>
<span class="lnr"> 6883 </span>    <span class="Comment">/*</span>
<span class="lnr"> 6884 </span><span class="Comment">     * 把HTML代码转换为DOM元素</span>
<span class="lnr"> 6885 </span><span class="Comment">     * elems: 待转换HTML代码数组</span>
<span class="lnr"> 6886 </span><span class="Comment">     * context: 文档对象,会调用context的createTextNode方法和createElement方法</span>
<span class="lnr"> 6887 </span><span class="Comment">     * fragment: 文档碎片,在其上插入div,在div上设置innerHTML</span>
<span class="lnr"> 6888 </span><span class="Comment">     * scripts: 脚本数组</span>
<span class="lnr"> 6889 </span><span class="Comment">     */</span>
<span class="lnr"> 6890 </span>    <span class="Statement">clean</span>: <span class="Identifier">function</span>( elems, context, fragment, scripts ) {
<span class="lnr"> 6891 </span>       <span class="Type">var</span> i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,
<span class="lnr"> 6892 </span>       <span class="Comment">/*</span>
<span class="lnr"> 6893 </span><span class="Comment">        * AND运算的逻辑如下:</span>
<span class="lnr"> 6894 </span><span class="Comment">        * 如果一个运算数是对象,另一个是 Boolean 值,返回该对象.</span>
<span class="lnr"> 6895 </span><span class="Comment">        * 如果两个运算数都是对象,返回第二个对象.</span>
<span class="lnr"> 6896 </span><span class="Comment">        * 如果某个运算数是 null,返回 null.</span>
<span class="lnr"> 6897 </span><span class="Comment">        * 如果某个运算数是 NaN,返回 NaN.</span>
<span class="lnr"> 6898 </span><span class="Comment">        * 如果某个运算数是 undefined,发生错误.</span>
<span class="lnr"> 6899 </span><span class="Comment">        */</span>
<span class="lnr"> 6900 </span>          safe = context === document &amp;&amp; safeFragment,
<span class="lnr"> 6901 </span>          ret = [];
<span class="lnr"> 6902 </span>
<span class="lnr"> 6903 </span><span class="Comment">       // Ensure that context is a document</span>
<span class="lnr"> 6904 </span><span class="Comment">       // 保证context是document</span>
<span class="lnr"> 6905 </span>       <span class="Statement">if</span> ( !context || <span class="Statement">typeof</span> context.createDocumentFragment === <span class="Constant">&quot;undefined&quot;</span> ) {
<span class="lnr"> 6906 </span>          context = document;
<span class="lnr"> 6907 </span>       }
<span class="lnr"> 6908 </span>
<span class="lnr"> 6909 </span><span class="Comment">       // Use the already-created safe fragment if context permits</span>
<span class="lnr"> 6910 </span><span class="Comment">       // 如果context允许,使用已经创建的安全fragment</span>
<span class="lnr"> 6911 </span>       <span class="Statement">for</span> ( i = <span class="Constant">0</span>; (elem = elems[i]) != <span class="Type">null</span>; i++ ) {
<span class="lnr"> 6912 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem === <span class="Constant">&quot;number&quot;</span> ) {
<span class="lnr"> 6913 </span>             elem += <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 6914 </span>          }
<span class="lnr"> 6915 </span>
<span class="lnr"> 6916 </span>          <span class="Statement">if</span> ( !elem ) {
<span class="lnr"> 6917 </span>             <span class="Statement">continue</span>;
<span class="lnr"> 6918 </span>          }
<span class="lnr"> 6919 </span>
<span class="lnr"> 6920 </span><span class="Comment">          // Convert html string into DOM nodes</span>
<span class="lnr"> 6921 </span><span class="Comment">          // 把html字符串转换为dom节点</span>
<span class="lnr"> 6922 </span>          <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 6923 </span>             <span class="Statement">if</span> ( !rhtml.test( elem ) ) {
<span class="lnr"> 6924 </span><span class="Comment">                // 创建文本节点</span>
<span class="lnr"> 6925 </span>                <span class="Comment">/*</span>
<span class="lnr"> 6926 </span><span class="Comment">                 * 如果不是HTML标签或特殊符号,则创建文本节点；rhtml = /&lt;|&amp;#?\w+;/；</span>
<span class="lnr"> 6927 </span><span class="Comment">                 * &lt;是HTML标签的起始符号,&amp;#?\w+则是特殊符号的起始符号,例如:</span>
<span class="lnr"> 6928 </span><span class="Comment">                 * 特殊符号     命名实体    十进制编码</span>
<span class="lnr"> 6929 </span><span class="Comment">                 * 空格        &amp;nbsp;   &amp;#160;      </span>
<span class="lnr"> 6930 </span><span class="Comment">                 * &lt;          &amp;lt;       &amp;#60;     </span>
<span class="lnr"> 6931 </span><span class="Comment">                 * &gt;          &amp;gt;       &amp;#62;</span>
<span class="lnr"> 6932 </span><span class="Comment">                 * &quot;          &amp;quot;   &amp;#34;        </span>
<span class="lnr"> 6933 </span><span class="Comment">                 * ×        &amp;times            </span>
<span class="lnr"> 6934 </span><span class="Comment">                 * ÷        &amp;divide;    </span>
<span class="lnr"> 6935 </span><span class="Comment">                 * ±        &amp;plusmn;    &amp;#177;      </span>
<span class="lnr"> 6936 </span><span class="Comment">                 * &amp;          &amp;amp;</span>
<span class="lnr"> 6937 </span><span class="Comment">                 * © 带圈的C    &amp;copy;   &amp;#169;      </span>
<span class="lnr"> 6938 </span><span class="Comment">                 * ® 带圈的R   &amp;reg;     &amp;#174;</span>
<span class="lnr"> 6939 </span><span class="Comment">                 */</span>
<span class="lnr"> 6940 </span>
<span class="lnr"> 6941 </span>                elem = context.createTextNode( elem );
<span class="lnr"> 6942 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 6943 </span><span class="Comment">                // Ensure a safe container in which to render the html</span>
<span class="lnr"> 6944 </span><span class="Comment">                // 确信将html渲染在一个安全的容器中</span>
<span class="lnr"> 6945 </span>                safe = safe || createSafeFragment( context );
<span class="lnr"> 6946 </span>                div = context.createElement(<span class="Constant">&quot;div&quot;</span>);
<span class="lnr"> 6947 </span>                safe.appendChild( div );
<span class="lnr"> 6948 </span>
<span class="lnr"> 6949 </span><span class="Comment">                // Fix &quot;XHTML&quot;-style tags in all browsers</span>
<span class="lnr"> 6950 </span><span class="Comment">                // 在所有浏览器中处理XHTML格式的标签</span>
<span class="lnr"> 6951 </span><span class="Comment">                // &lt;div class=&quot;abc&quot; style=&quot;abc&quot; custome=&quot;abc&quot;/&gt;处理后结果为:</span>
<span class="lnr"> 6952 </span><span class="Comment">                // &lt;div class=&quot;abc&quot; style=&quot;abc&quot; custome=&quot;abc&quot;&gt;&lt;/div&gt; </span>
<span class="lnr"> 6953 </span>                elem = elem.replace(rxhtmlTag, <span class="Constant">&quot;&lt;$1&gt;&lt;/$2&gt;&quot;</span>);
<span class="lnr"> 6954 </span>
<span class="lnr"> 6955 </span><span class="Comment">                // Go to html and back, then peel off extra wrappers</span>
<span class="lnr"> 6956 </span><span class="Comment">                // 匹配html标签,[&quot;&quot;, &quot;&quot;]是为了保证后面的[1]操作不抛异常</span>
<span class="lnr"> 6957 </span>                tag = ( rtagName.exec( elem ) || [<span class="Constant">&quot;&quot;</span>, <span class="Constant">&quot;&quot;</span>] )[<span class="Constant">1</span>].toLowerCase();
<span class="lnr"> 6958 </span><span class="Comment">                // 包裹标签,处理option td之类的需要被包裹的标签,同时需要移动层数</span>
<span class="lnr"> 6959 </span><span class="Comment">                // wrapMap存放标签配置数据的对象,如果元素不需要包裹,则默认使用div进行包裹</span>
<span class="lnr"> 6960 </span>                wrap = wrapMap[ tag ] || wrapMap._default;
<span class="lnr"> 6961 </span>                depth = wrap[<span class="Constant">0</span>];
<span class="lnr"> 6962 </span>                div.innerHTML = wrap[<span class="Constant">1</span>] + elem + wrap[<span class="Constant">2</span>];
<span class="lnr"> 6963 </span>
<span class="lnr"> 6964 </span><span class="Comment">                // Move to the right depth</span>
<span class="lnr"> 6965 </span><span class="Comment">                // 包裹标签后通过innerHTML的方式生成dom节点</span>
<span class="lnr"> 6966 </span><span class="Comment">                // 再去除包裹,拿到要生成的dom元素的父节点</span>
<span class="lnr"> 6967 </span><span class="Comment">                // td被包裹后通过innerHTML放置到div中,结构为div&gt;table&gt;tbody&gt;tr&gt;td</span>
<span class="lnr"> 6968 </span><span class="Comment">                // td的depth为3,在div上去除三层包裹,得到tr&gt;td</span>
<span class="lnr"> 6969 </span>                <span class="Statement">while</span> ( depth-- ) {
<span class="lnr"> 6970 </span>                   div = div.lastChild;
<span class="lnr"> 6971 </span>                }
<span class="lnr"> 6972 </span>
<span class="lnr"> 6973 </span><span class="Comment">                // Remove IE's autoinserted &lt;tbody&gt; from table fragments</span>
<span class="lnr"> 6974 </span><span class="Comment">                // 移除IE在table片段中自动插入的tbody标签</span>
<span class="lnr"> 6975 </span>                <span class="Statement">if</span> ( !jQuery.support.tbody ) {
<span class="lnr"> 6976 </span>
<span class="lnr"> 6977 </span><span class="Comment">                   // String was a &lt;table&gt;, *may* have spurious &lt;tbody&gt;</span>
<span class="lnr"> 6978 </span><span class="Comment">                   // elem中含有tbody标签</span>
<span class="lnr"> 6979 </span>                   hasBody = rtbody.test(elem);
<span class="lnr"> 6980 </span><span class="Comment">/*</span>
<span class="lnr"> 6981 </span>
<span class="lnr"> 6982 </span><span class="Comment">table                       tbody                 thead/ftoot</span>
<span class="lnr"> 6983 </span><span class="Comment">从elem解析出来的tag是否table        elem中是否含有tbody        从elem解析出来的tag是否thead/ftoot   </span>
<span class="lnr"> 6984 </span>
<span class="lnr"> 6985 </span><span class="Comment"> </span>
<span class="lnr"> 6986 </span><span class="Comment">true/false                  true                   true/false                     只要elem中自带tbody,不需要删除,所以:[]</span>
<span class="lnr"> 6987 </span>
<span class="lnr"> 6988 </span><span class="Comment">true                         false                 false                          变量div是DIV元素,firstChild是TABLE元素,IE会自</span>
<span class="lnr"> 6989 </span><span class="Comment">                                                                               动添加空tbody,所以:div.firstChild.childNodes</span>
<span class="lnr"> 6990 </span>
<span class="lnr"> 6991 </span><span class="Comment">false                       false                 true                            变量div是TABLE元素,IE会自动添加空tbody,所以:</span>
<span class="lnr"> 6992 </span><span class="Comment">                                                                               div.childNodes</span>
<span class="lnr"> 6993 </span>
<span class="lnr"> 6994 </span><span class="Comment">false                       false                 false                          如果elem是th/tr/td/col,jQuery自动插入tbody,</span>
<span class="lnr"> 6995 </span><span class="Comment">                                                                               变量div是TBODY元素,不需要删除；如果elem是其他标</span>
<span class="lnr"> 6996 </span><span class="Comment">                                                                               签,也不需要删除,所以:[]</span>
<span class="lnr"> 6997 </span><span class="Comment">*/</span>
<span class="lnr"> 6998 </span>                      tbody = tag === <span class="Constant">&quot;table&quot;</span> &amp;&amp; !hasBody ?
<span class="lnr"> 6999 </span>                         div.firstChild &amp;&amp; div.firstChild.<span class="Statement">childNodes</span> :
<span class="lnr"> 7000 </span>
<span class="lnr"> 7001 </span><span class="Comment">                         // String was a bare &lt;thead&gt; or &lt;tfoot&gt;</span>
<span class="lnr"> 7002 </span><span class="Comment">                         // 如果父标签是table（包裹标签）,且elem中没有tbody,即elem中是thead/tfoot</span>
<span class="lnr"> 7003 </span>                         wrap[<span class="Constant">1</span>] === <span class="Constant">&quot;&lt;table&gt;&quot;</span> &amp;&amp; !hasBody ?
<span class="lnr"> 7004 </span>                            div.<span class="Statement">childNodes</span> :
<span class="lnr"> 7005 </span>                            [];
<span class="lnr"> 7006 </span>
<span class="lnr"> 7007 </span><span class="Comment">                   // 在for循环中遍历取到的tbody（可能含有thead/tfoot）,删除IE自动添加的空tbody,非空tbody不会删除</span>
<span class="lnr"> 7008 </span>                   <span class="Statement">for</span> ( j = tbody.length - <span class="Constant">1</span>; j &gt;= <span class="Constant">0</span> ; --j ) {
<span class="lnr"> 7009 </span>                      <span class="Statement">if</span> ( jQuery.nodeName( tbody[ j ], <span class="Constant">&quot;tbody&quot;</span> ) &amp;&amp; !tbody[ j ].childNodes.length ) {
<span class="lnr"> 7010 </span>                         tbody[ j ].parentNode.removeChild( tbody[ j ] );
<span class="lnr"> 7011 </span>                      }
<span class="lnr"> 7012 </span>                   }
<span class="lnr"> 7013 </span>                }
<span class="lnr"> 7014 </span>
<span class="lnr"> 7015 </span><span class="Comment">                // IE completely kills leading whitespace when innerHTML is used</span>
<span class="lnr"> 7016 </span><span class="Comment">                // IE在使用innerHTML时会删除前导空格</span>
<span class="lnr"> 7017 </span>                <span class="Statement">if</span> ( !jQuery.support.leadingWhitespace &amp;&amp; rleadingWhitespace.test( elem ) ) {
<span class="lnr"> 7018 </span>                   div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[<span class="Constant">0</span>] ), div.firstChild );
<span class="lnr"> 7019 </span>                }
<span class="lnr"> 7020 </span><span class="Comment">                // 返回真正需要创建的标签,如果标记需要包裹,变量div不再指向最初的div元素</span>
<span class="lnr"> 7021 </span>                elem = div.childNodes;
<span class="lnr"> 7022 </span>
<span class="lnr"> 7023 </span><span class="Comment">                // Take out of fragment container (we need a fresh div each time)</span>
<span class="lnr"> 7024 </span><span class="Comment">                // 移除用来生成节点的div</span>
<span class="lnr"> 7025 </span>                div.parentNode.removeChild( div );
<span class="lnr"> 7026 </span>             }
<span class="lnr"> 7027 </span>          }
<span class="lnr"> 7028 </span>
<span class="lnr"> 7029 </span><span class="Comment">          // 将结果压入或者合并回返回值数组</span>
<span class="lnr"> 7030 </span>          <span class="Statement">if</span> ( elem.nodeType ) {
<span class="lnr"> 7031 </span>             ret.push( elem );
<span class="lnr"> 7032 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 7033 </span>             jQuery.merge( ret, elem );
<span class="lnr"> 7034 </span>          }
<span class="lnr"> 7035 </span>       }
<span class="lnr"> 7036 </span>
<span class="lnr"> 7037 </span><span class="Comment">       // Fix #11356: Clear elements from safeFragment</span>
<span class="lnr"> 7038 </span><span class="Comment">       // 清理用到的临时变量</span>
<span class="lnr"> 7039 </span>       <span class="Statement">if</span> ( div ) {
<span class="lnr"> 7040 </span>          elem = div = safe = <span class="Type">null</span>;
<span class="lnr"> 7041 </span>       }
<span class="lnr"> 7042 </span>
<span class="lnr"> 7043 </span><span class="Comment">       // Reset defaultChecked for any radios and checkboxes</span>
<span class="lnr"> 7044 </span><span class="Comment">       // about to be appended to the DOM in IE 6/7 (#8060)</span>
<span class="lnr"> 7045 </span><span class="Comment">       // 修正IE6/7中的radios、checkboxes的defaultChecked属性</span>
<span class="lnr"> 7046 </span>       <span class="Statement">if</span> ( !jQuery.support.appendChecked ) {
<span class="lnr"> 7047 </span>          <span class="Statement">for</span> ( i = <span class="Constant">0</span>; (elem = ret[i]) != <span class="Type">null</span>; i++ ) {
<span class="lnr"> 7048 </span>             <span class="Statement">if</span> ( jQuery.nodeName( elem, <span class="Constant">&quot;input&quot;</span> ) ) {
<span class="lnr"> 7049 </span>                fixDefaultChecked( elem );
<span class="lnr"> 7050 </span>             } <span class="Statement">else</span> <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem.getElementsByTagName !== <span class="Constant">&quot;undefined&quot;</span> ) {
<span class="lnr"> 7051 </span>                jQuery.grep( elem.getElementsByTagName(<span class="Constant">&quot;input&quot;</span>), fixDefaultChecked );
<span class="lnr"> 7052 </span>             }
<span class="lnr"> 7053 </span>          }
<span class="lnr"> 7054 </span>       }
<span class="lnr"> 7055 </span>
<span class="lnr"> 7056 </span><span class="Comment">       // Append elements to a provided document fragment</span>
<span class="lnr"> 7057 </span><span class="Comment">       // 附加元素到提供的fragment上</span>
<span class="lnr"> 7058 </span>       <span class="Statement">if</span> ( fragment ) {
<span class="lnr"> 7059 </span><span class="Comment">          // Special handling of each script element</span>
<span class="lnr"> 7060 </span><span class="Comment">          // 特殊处理每一个脚本元素</span>
<span class="lnr"> 7061 </span>          handleScript = <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 7062 </span><span class="Comment">             // Check if we consider it executable</span>
<span class="lnr"> 7063 </span><span class="Comment">             // 检查脚本是否可执行</span>
<span class="lnr"> 7064 </span>             <span class="Statement">if</span> ( !elem.type || rscriptType.test( elem.type ) ) {
<span class="lnr"> 7065 </span><span class="Comment">                // Detach the script and store it in the scripts array (if provided) or the fragment</span>
<span class="lnr"> 7066 </span><span class="Comment">                // Return truthy to indicate that it has been handled</span>
<span class="lnr"> 7067 </span><span class="Comment">                // 分离脚本,如果提供了scripts数组,则存储到scripts数组中,如果没有,则直接附加</span>
<span class="lnr"> 7068 </span>                <span class="Statement">return</span> scripts ?
<span class="lnr"> 7069 </span>                   scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
<span class="lnr"> 7070 </span>                   fragment.appendChild( elem );
<span class="lnr"> 7071 </span>             }
<span class="lnr"> 7072 </span>          };
<span class="lnr"> 7073 </span>
<span class="lnr"> 7074 </span>          <span class="Statement">for</span> ( i = <span class="Constant">0</span>; (elem = ret[i]) != <span class="Type">null</span>; i++ ) {
<span class="lnr"> 7075 </span><span class="Comment">             // Check if we're done after handling an executable script</span>
<span class="lnr"> 7076 </span><span class="Comment">             // 检查是否处理了所有脚本元素</span>
<span class="lnr"> 7077 </span>             <span class="Statement">if</span> ( !( jQuery.nodeName( elem, <span class="Constant">&quot;script&quot;</span> ) &amp;&amp; handleScript( elem ) ) ) {
<span class="lnr"> 7078 </span><span class="Comment">                // Append to fragment and handle embedded scripts</span>
<span class="lnr"> 7079 </span><span class="Comment">                // 附加元素并且处理脚本</span>
<span class="lnr"> 7080 </span>                fragment.appendChild( elem );
<span class="lnr"> 7081 </span>                <span class="Statement">if</span> ( <span class="Statement">typeof</span> elem.getElementsByTagName !== <span class="Constant">&quot;undefined&quot;</span> ) {
<span class="lnr"> 7082 </span><span class="Comment">                   // handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration</span>
<span class="lnr"> 7083 </span><span class="Comment">                   // handleScript会改变DOM,所以使用jQuery.merge实现对快照进行遍历</span>
<span class="lnr"> 7084 </span>                   jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName(<span class="Constant">&quot;script&quot;</span>) ), handleScript );
<span class="lnr"> 7085 </span>
<span class="lnr"> 7086 </span><span class="Comment">                   // Splice the scripts into ret after their former ancestor and advance our index beyond them</span>
<span class="lnr"> 7087 </span><span class="Comment">                   // 将scripts插入到他们的正式的祖先后面并且增加index,跳过新增加的元素</span>
<span class="lnr"> 7088 </span><span class="Comment">                   // 通过apply(this,arguments)的形式传递参数,[i+1,0,jsTags ]为splice函数需要使用的参数</span>
<span class="lnr"> 7089 </span>                   ret.splice.apply( ret, [i + <span class="Constant">1</span>, <span class="Constant">0</span>].concat( jsTags ) );
<span class="lnr"> 7090 </span>                   i += jsTags.length;
<span class="lnr"> 7091 </span>                }
<span class="lnr"> 7092 </span>             }
<span class="lnr"> 7093 </span>          }
<span class="lnr"> 7094 </span>       }
<span class="lnr"> 7095 </span>
<span class="lnr"> 7096 </span>       <span class="Statement">return</span> ret;
<span class="lnr"> 7097 </span>    },
<span class="lnr"> 7098 </span>
<span class="lnr"> 7099 </span><span class="Comment">    // 清理数据</span>
<span class="lnr"> 7100 </span>    <span class="Statement">cleanData</span>: <span class="Identifier">function</span>( elems, <span class="Comment">/* internal */</span> acceptData ) {
<span class="lnr"> 7101 </span>       <span class="Type">var</span> data, id, elem, type,
<span class="lnr"> 7102 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 7103 </span>          internalKey = jQuery.expando,
<span class="lnr"> 7104 </span>          cache = jQuery.cache,
<span class="lnr"> 7105 </span>          deleteExpando = jQuery.support.deleteExpando,
<span class="lnr"> 7106 </span>          special = jQuery.event.special;
<span class="lnr"> 7107 </span>
<span class="lnr"> 7108 </span>       <span class="Statement">for</span> ( ; (elem = elems[i]) != <span class="Type">null</span>; i++ ) {
<span class="lnr"> 7109 </span>
<span class="lnr"> 7110 </span>          <span class="Statement">if</span> ( acceptData || jQuery.acceptData( elem ) ) {
<span class="lnr"> 7111 </span>
<span class="lnr"> 7112 </span>             id = elem[ internalKey ];
<span class="lnr"> 7113 </span>             data = id &amp;&amp; cache[ id ];
<span class="lnr"> 7114 </span>
<span class="lnr"> 7115 </span>             <span class="Statement">if</span> ( data ) {
<span class="lnr"> 7116 </span>                <span class="Statement">if</span> ( data.events ) {
<span class="lnr"> 7117 </span><span class="Comment">                   // 移除事件</span>
<span class="lnr"> 7118 </span>                   <span class="Statement">for</span> ( type <span class="Statement">in</span> data.events ) {
<span class="lnr"> 7119 </span>                      <span class="Statement">if</span> ( special[ type ] ) {
<span class="lnr"> 7120 </span>                         jQuery.event.remove( elem, type );
<span class="lnr"> 7121 </span>
<span class="lnr"> 7122 </span><span class="Comment">                      // This is a shortcut to avoid jQuery.event.remove's overhead</span>
<span class="lnr"> 7123 </span><span class="Comment">                      // 避免jQuery.event.remove过度的便捷方法</span>
<span class="lnr"> 7124 </span>                      } <span class="Statement">else</span> {
<span class="lnr"> 7125 </span>                         jQuery.removeEvent( elem, type, data.handle );
<span class="lnr"> 7126 </span>                      }
<span class="lnr"> 7127 </span>                   }
<span class="lnr"> 7128 </span>                }
<span class="lnr"> 7129 </span>
<span class="lnr"> 7130 </span><span class="Comment">                // Remove cache only if it was not already removed by jQuery.event.remove</span>
<span class="lnr"> 7131 </span><span class="Comment">                // 如果cache没有被jQuery.event.remove移除,再移除cache</span>
<span class="lnr"> 7132 </span>                <span class="Statement">if</span> ( cache[ id ] ) {
<span class="lnr"> 7133 </span>
<span class="lnr"> 7134 </span>                   <span class="Statement">delete</span> cache[ id ];
<span class="lnr"> 7135 </span>
<span class="lnr"> 7136 </span><span class="Comment">                   // IE does not allow us to delete expando properties from nodes,</span>
<span class="lnr"> 7137 </span><span class="Comment">                   // IE不允许删除节点的扩展属性</span>
<span class="lnr"> 7138 </span><span class="Comment">                   // nor does it have a removeAttribute function on Document nodes;</span>
<span class="lnr"> 7139 </span><span class="Comment">                   // 并且也没有提供一个移除属性的方法</span>
<span class="lnr"> 7140 </span><span class="Comment">                   // we must handle all of these cases</span>
<span class="lnr"> 7141 </span><span class="Comment">                   // 必须处理所有情况</span>
<span class="lnr"> 7142 </span>                   <span class="Statement">if</span> ( deleteExpando ) {
<span class="lnr"> 7143 </span>                      <span class="Statement">delete</span> elem[ internalKey ];
<span class="lnr"> 7144 </span>
<span class="lnr"> 7145 </span>                   } <span class="Statement">else</span> <span class="Statement">if</span> ( elem.removeAttribute ) {
<span class="lnr"> 7146 </span>                      elem.removeAttribute( internalKey );
<span class="lnr"> 7147 </span>
<span class="lnr"> 7148 </span>                   } <span class="Statement">else</span> {
<span class="lnr"> 7149 </span><span class="Comment">                      // IE无法移除标签,只能将其值置为空</span>
<span class="lnr"> 7150 </span>                      elem[ internalKey ] = <span class="Type">null</span>;
<span class="lnr"> 7151 </span>                   }
<span class="lnr"> 7152 </span>
<span class="lnr"> 7153 </span>                   jQuery.deletedIds.push( id );
<span class="lnr"> 7154 </span>                }
<span class="lnr"> 7155 </span>             }
<span class="lnr"> 7156 </span>          }
<span class="lnr"> 7157 </span>       }
<span class="lnr"> 7158 </span>    }
<span class="lnr"> 7159 </span>});
<span class="lnr"> 7160 </span><span class="Comment">// Limit scope pollution from any deprecated API</span>
<span class="lnr"> 7161 </span>(<span class="Identifier">function</span>() {
<span class="lnr"> 7162 </span>
<span class="lnr"> 7163 </span><span class="Type">var</span> matched, browser;
<span class="lnr"> 7164 </span>
<span class="lnr"> 7165 </span><span class="Comment">// Use of jQuery.browser is frowned upon.</span>
<span class="lnr"> 7166 </span><span class="Comment">// More details: <a href="http://api.jquery.com/jQuery.browser">http://api.jquery.com/jQuery.browser</a></span>
<span class="lnr"> 7167 </span><span class="Comment">// jQuery.uaMatch maintained for back-compat</span>
<span class="lnr"> 7168 </span>jQuery.uaMatch = <span class="Identifier">function</span>( ua ) {
<span class="lnr"> 7169 </span>    ua = ua.toLowerCase();
<span class="lnr"> 7170 </span>
<span class="lnr"> 7171 </span>    <span class="Type">var</span> match = <span class="Constant">/(chrome)[ </span><span class="Special">\/</span><span class="Constant">]([</span><span class="Special">\w</span><span class="Constant">.]+)/</span>.exec( ua ) ||
<span class="lnr"> 7172 </span>       <span class="Constant">/(webkit)[ </span><span class="Special">\/</span><span class="Constant">]([</span><span class="Special">\w</span><span class="Constant">.]+)/</span>.exec( ua ) ||
<span class="lnr"> 7173 </span>       <span class="Constant">/(opera)(?:.*version|)[ </span><span class="Special">\/</span><span class="Constant">]([</span><span class="Special">\w</span><span class="Constant">.]+)/</span>.exec( ua ) ||
<span class="lnr"> 7174 </span>       <span class="Constant">/(msie) ([</span><span class="Special">\w</span><span class="Constant">.]+)/</span>.exec( ua ) ||
<span class="lnr"> 7175 </span>       ua.indexOf(<span class="Constant">&quot;compatible&quot;</span>) &lt; <span class="Constant">0</span> &amp;&amp; <span class="Constant">/(mozilla)(?:.*? rv:([</span><span class="Special">\w</span><span class="Constant">.]+)|)/</span>.exec( ua ) ||
<span class="lnr"> 7176 </span>       [];
<span class="lnr"> 7177 </span>
<span class="lnr"> 7178 </span>    <span class="Statement">return</span> {
<span class="lnr"> 7179 </span>       <span class="Statement">browser</span>: match[ <span class="Constant">1</span> ] || <span class="Constant">&quot;&quot;</span>,
<span class="lnr"> 7180 </span>       <span class="Statement">version</span>: match[ <span class="Constant">2</span> ] || <span class="Constant">&quot;0&quot;</span>
<span class="lnr"> 7181 </span>    };
<span class="lnr"> 7182 </span>};
<span class="lnr"> 7183 </span>
<span class="lnr"> 7184 </span>matched = jQuery.uaMatch( navigator.userAgent );
<span class="lnr"> 7185 </span>browser = {};
<span class="lnr"> 7186 </span>
<span class="lnr"> 7187 </span><span class="Statement">if</span> ( matched.browser ) {
<span class="lnr"> 7188 </span>    browser[ matched.browser ] = <span class="Constant">true</span>;
<span class="lnr"> 7189 </span>    browser.version = matched.version;
<span class="lnr"> 7190 </span>}
<span class="lnr"> 7191 </span>
<span class="lnr"> 7192 </span><span class="Comment">// Chrome is Webkit, but Webkit is also Safari.</span>
<span class="lnr"> 7193 </span><span class="Statement">if</span> ( browser.chrome ) {
<span class="lnr"> 7194 </span>    browser.webkit = <span class="Constant">true</span>;
<span class="lnr"> 7195 </span>} <span class="Statement">else</span> <span class="Statement">if</span> ( browser.webkit ) {
<span class="lnr"> 7196 </span>    browser.safari = <span class="Constant">true</span>;
<span class="lnr"> 7197 </span>}
<span class="lnr"> 7198 </span>
<span class="lnr"> 7199 </span>jQuery.browser = browser;
<span class="lnr"> 7200 </span>
<span class="lnr"> 7201 </span>jQuery.sub = <span class="Identifier">function</span>() {
<span class="lnr"> 7202 </span>    <span class="Identifier">function</span> jQuerySub( selector, context ) {
<span class="lnr"> 7203 </span>       <span class="Statement">return</span> <span class="Statement">new</span> jQuerySub.fn.init( selector, context );
<span class="lnr"> 7204 </span>    }
<span class="lnr"> 7205 </span>    jQuery.extend( <span class="Constant">true</span>, jQuerySub, <span class="Type">this</span> );
<span class="lnr"> 7206 </span>    jQuerySub.superclass = <span class="Type">this</span>;
<span class="lnr"> 7207 </span>    jQuerySub.fn = jQuerySub.prototype = <span class="Type">this</span>();
<span class="lnr"> 7208 </span>    jQuerySub.fn.constructor = jQuerySub;
<span class="lnr"> 7209 </span>    jQuerySub.sub = <span class="Type">this</span>.sub;
<span class="lnr"> 7210 </span>    jQuerySub.fn.init = <span class="Identifier">function</span> init( selector, context ) {
<span class="lnr"> 7211 </span>       <span class="Statement">if</span> ( context &amp;&amp; context <span class="Statement">instanceof</span> jQuery &amp;&amp; !(context <span class="Statement">instanceof</span> jQuerySub) ) {
<span class="lnr"> 7212 </span>          context = jQuerySub( context );
<span class="lnr"> 7213 </span>       }
<span class="lnr"> 7214 </span>
<span class="lnr"> 7215 </span>       <span class="Statement">return</span> jQuery.fn.init.call( <span class="Type">this</span>, selector, context, rootjQuerySub );
<span class="lnr"> 7216 </span>    };
<span class="lnr"> 7217 </span>    jQuerySub.fn.init.prototype = jQuerySub.fn;
<span class="lnr"> 7218 </span>    <span class="Type">var</span> rootjQuerySub = jQuerySub(document);
<span class="lnr"> 7219 </span>    <span class="Statement">return</span> jQuerySub;
<span class="lnr"> 7220 </span>};
<span class="lnr"> 7221 </span>
<span class="lnr"> 7222 </span>})();
<span class="lnr"> 7223 </span><span class="Type">var</span> curCSS, iframe, iframeDoc,
<span class="lnr"> 7224 </span>    ralpha = <span class="Constant">/alpha</span><span class="Special">\(</span><span class="Constant">[^)]*</span><span class="Special">\)</span><span class="Constant">/i</span>,
<span class="lnr"> 7225 </span>    ropacity = <span class="Constant">/opacity=([^)]*)/</span>,
<span class="lnr"> 7226 </span>    rposition = <span class="Constant">/^(top|right|bottom|left)$/</span>,
<span class="lnr"> 7227 </span><span class="Comment">    // swappable if display is none or starts with table except &quot;table&quot;, &quot;table-cell&quot;, or &quot;table-caption&quot;</span>
<span class="lnr"> 7228 </span><span class="Comment">    // see here for display values: <a href="https://developer.mozilla.org/en-US/docs/CSS/display">https://developer.mozilla.org/en-US/docs/CSS/display</a></span>
<span class="lnr"> 7229 </span>    rdisplayswap = <span class="Constant">/^(none|table(?!-c[ea]).+)/</span>,
<span class="lnr"> 7230 </span>    rmargin = <span class="Constant">/^margin/</span>,
<span class="lnr"> 7231 </span>    rnumsplit = <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^(&quot;</span> + core_pnum + <span class="Constant">&quot;)(.*)$&quot;</span>, <span class="Constant">&quot;i&quot;</span> ),
<span class="lnr"> 7232 </span>    rnumnonpx = <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^(&quot;</span> + core_pnum + <span class="Constant">&quot;)(?!px)[a-z%]+$&quot;</span>, <span class="Constant">&quot;i&quot;</span> ),
<span class="lnr"> 7233 </span>    rrelNum = <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^([-+])=(&quot;</span> + core_pnum + <span class="Constant">&quot;)&quot;</span>, <span class="Constant">&quot;i&quot;</span> ),
<span class="lnr"> 7234 </span>    elemdisplay = {},
<span class="lnr"> 7235 </span>
<span class="lnr"> 7236 </span>    cssShow = { <span class="Statement">position</span>: <span class="Constant">&quot;absolute&quot;</span>, <span class="Statement">visibility</span>: <span class="Constant">&quot;hidden&quot;</span>, <span class="Statement">display</span>: <span class="Constant">&quot;block&quot;</span> },
<span class="lnr"> 7237 </span>    cssNormalTransform = {
<span class="lnr"> 7238 </span>       <span class="Statement">letterSpacing</span>: <span class="Constant">0</span>,
<span class="lnr"> 7239 </span>       <span class="Statement">fontWeight</span>: <span class="Constant">400</span>
<span class="lnr"> 7240 </span>    },
<span class="lnr"> 7241 </span>
<span class="lnr"> 7242 </span>    cssExpand = [ <span class="Constant">&quot;Top&quot;</span>, <span class="Constant">&quot;Right&quot;</span>, <span class="Constant">&quot;Bottom&quot;</span>, <span class="Constant">&quot;Left&quot;</span> ],
<span class="lnr"> 7243 </span>    cssPrefixes = [ <span class="Constant">&quot;Webkit&quot;</span>, <span class="Constant">&quot;O&quot;</span>, <span class="Constant">&quot;Moz&quot;</span>, <span class="Constant">&quot;ms&quot;</span> ],
<span class="lnr"> 7244 </span>
<span class="lnr"> 7245 </span>    eventsToggle = jQuery.fn.toggle;
<span class="lnr"> 7246 </span>
<span class="lnr"> 7247 </span><span class="Comment">// return a css property mapped to a potentially vendor prefixed property</span>
<span class="lnr"> 7248 </span><span class="Identifier">function</span> vendorPropName( style, name ) {
<span class="lnr"> 7249 </span>
<span class="lnr"> 7250 </span><span class="Comment">    // shortcut for names that are not vendor prefixed</span>
<span class="lnr"> 7251 </span>    <span class="Statement">if</span> ( name <span class="Statement">in</span> style ) {
<span class="lnr"> 7252 </span>       <span class="Statement">return</span> name;
<span class="lnr"> 7253 </span>    }
<span class="lnr"> 7254 </span>
<span class="lnr"> 7255 </span><span class="Comment">    // check for vendor prefixed names</span>
<span class="lnr"> 7256 </span>    <span class="Type">var</span> capName = name.charAt(<span class="Constant">0</span>).toUpperCase() + name.slice(<span class="Constant">1</span>),
<span class="lnr"> 7257 </span>       origName = name,
<span class="lnr"> 7258 </span>       i = cssPrefixes.length;
<span class="lnr"> 7259 </span>
<span class="lnr"> 7260 </span>    <span class="Statement">while</span> ( i-- ) {
<span class="lnr"> 7261 </span>       name = cssPrefixes[ i ] + capName;
<span class="lnr"> 7262 </span>       <span class="Statement">if</span> ( name <span class="Statement">in</span> style ) {
<span class="lnr"> 7263 </span>          <span class="Statement">return</span> name;
<span class="lnr"> 7264 </span>       }
<span class="lnr"> 7265 </span>    }
<span class="lnr"> 7266 </span>
<span class="lnr"> 7267 </span>    <span class="Statement">return</span> origName;
<span class="lnr"> 7268 </span>}
<span class="lnr"> 7269 </span>
<span class="lnr"> 7270 </span><span class="Identifier">function</span> isHidden( elem, el ) {
<span class="lnr"> 7271 </span>    elem = el || elem;
<span class="lnr"> 7272 </span>    <span class="Statement">return</span> jQuery.css( elem, <span class="Constant">&quot;display&quot;</span> ) === <span class="Constant">&quot;none&quot;</span> || !jQuery.contains( elem.ownerDocument, elem );
<span class="lnr"> 7273 </span>}
<span class="lnr"> 7274 </span>
<span class="lnr"> 7275 </span><span class="Identifier">function</span> showHide( elements, show ) {
<span class="lnr"> 7276 </span>    <span class="Type">var</span> elem, display,
<span class="lnr"> 7277 </span>       values = [],
<span class="lnr"> 7278 </span>       index = <span class="Constant">0</span>,
<span class="lnr"> 7279 </span>       length = elements.length;
<span class="lnr"> 7280 </span>
<span class="lnr"> 7281 </span>    <span class="Statement">for</span> ( ; index &lt; length; index++ ) {
<span class="lnr"> 7282 </span>       elem = elements[ index ];
<span class="lnr"> 7283 </span>       <span class="Statement">if</span> ( !elem.style ) {
<span class="lnr"> 7284 </span>          <span class="Statement">continue</span>;
<span class="lnr"> 7285 </span>       }
<span class="lnr"> 7286 </span>       values[ index ] = jQuery._data( elem, <span class="Constant">&quot;olddisplay&quot;</span> );
<span class="lnr"> 7287 </span>       <span class="Statement">if</span> ( show ) {
<span class="lnr"> 7288 </span><span class="Comment">          // Reset the inline display of this element to learn if it is</span>
<span class="lnr"> 7289 </span><span class="Comment">          // being hidden by cascaded rules or not</span>
<span class="lnr"> 7290 </span>          <span class="Statement">if</span> ( !values[ index ] &amp;&amp; elem.style.display === <span class="Constant">&quot;none&quot;</span> ) {
<span class="lnr"> 7291 </span>             elem.style.display = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 7292 </span>          }
<span class="lnr"> 7293 </span>
<span class="lnr"> 7294 </span><span class="Comment">          // Set elements which have been overridden with display: none</span>
<span class="lnr"> 7295 </span><span class="Comment">          // in a stylesheet to whatever the default browser style is</span>
<span class="lnr"> 7296 </span><span class="Comment">          // for such an element</span>
<span class="lnr"> 7297 </span>          <span class="Statement">if</span> ( elem.style.display === <span class="Constant">&quot;&quot;</span> &amp;&amp; isHidden( elem ) ) {
<span class="lnr"> 7298 </span>             values[ index ] = jQuery._data( elem, <span class="Constant">&quot;olddisplay&quot;</span>, css_defaultDisplay(elem.nodeName) );
<span class="lnr"> 7299 </span>          }
<span class="lnr"> 7300 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 7301 </span>          display = curCSS( elem, <span class="Constant">&quot;display&quot;</span> );
<span class="lnr"> 7302 </span>
<span class="lnr"> 7303 </span>          <span class="Statement">if</span> ( !values[ index ] &amp;&amp; display !== <span class="Constant">&quot;none&quot;</span> ) {
<span class="lnr"> 7304 </span>             jQuery._data( elem, <span class="Constant">&quot;olddisplay&quot;</span>, display );
<span class="lnr"> 7305 </span>          }
<span class="lnr"> 7306 </span>       }
<span class="lnr"> 7307 </span>    }
<span class="lnr"> 7308 </span>
<span class="lnr"> 7309 </span><span class="Comment">    // Set the display of most of the elements in a second loop</span>
<span class="lnr"> 7310 </span><span class="Comment">    // to avoid the constant reflow</span>
<span class="lnr"> 7311 </span>    <span class="Statement">for</span> ( index = <span class="Constant">0</span>; index &lt; length; index++ ) {
<span class="lnr"> 7312 </span>       elem = elements[ index ];
<span class="lnr"> 7313 </span>       <span class="Statement">if</span> ( !elem.style ) {
<span class="lnr"> 7314 </span>          <span class="Statement">continue</span>;
<span class="lnr"> 7315 </span>       }
<span class="lnr"> 7316 </span>       <span class="Statement">if</span> ( !show || elem.style.display === <span class="Constant">&quot;none&quot;</span> || elem.style.display === <span class="Constant">&quot;&quot;</span> ) {
<span class="lnr"> 7317 </span>          elem.style.display = show ? values[ index ] || <span class="Constant">&quot;&quot;</span> : <span class="Constant">&quot;none&quot;</span>;
<span class="lnr"> 7318 </span>       }
<span class="lnr"> 7319 </span>    }
<span class="lnr"> 7320 </span>
<span class="lnr"> 7321 </span>    <span class="Statement">return</span> elements;
<span class="lnr"> 7322 </span>}
<span class="lnr"> 7323 </span>
<span class="lnr"> 7324 </span>jQuery.fn.extend({
<span class="lnr"> 7325 </span>    <span class="Statement">css</span>: <span class="Identifier">function</span>( name, value ) {
<span class="lnr"> 7326 </span>       <span class="Statement">return</span> jQuery.access( <span class="Type">this</span>, <span class="Identifier">function</span>( elem, name, value ) {
<span class="lnr"> 7327 </span>          <span class="Statement">return</span> value !== <span class="Type">undefined</span> ?
<span class="lnr"> 7328 </span>             jQuery.style( elem, name, value ) :
<span class="lnr"> 7329 </span>             jQuery.css( elem, name );
<span class="lnr"> 7330 </span>       }, name, value, arguments.length &gt; <span class="Constant">1</span> );
<span class="lnr"> 7331 </span>    },
<span class="lnr"> 7332 </span>    <span class="Statement">show</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 7333 </span>       <span class="Statement">return</span> showHide( <span class="Type">this</span>, <span class="Constant">true</span> );
<span class="lnr"> 7334 </span>    },
<span class="lnr"> 7335 </span>    <span class="Statement">hide</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 7336 </span>       <span class="Statement">return</span> showHide( <span class="Type">this</span> );
<span class="lnr"> 7337 </span>    },
<span class="lnr"> 7338 </span>    <span class="Statement">toggle</span>: <span class="Identifier">function</span>( state, fn2 ) {
<span class="lnr"> 7339 </span>       <span class="Type">var</span> bool = <span class="Statement">typeof</span> state === <span class="Constant">&quot;boolean&quot;</span>;
<span class="lnr"> 7340 </span>
<span class="lnr"> 7341 </span>       <span class="Statement">if</span> ( jQuery.isFunction( state ) &amp;&amp; jQuery.isFunction( fn2 ) ) {
<span class="lnr"> 7342 </span>          <span class="Statement">return</span> eventsToggle.apply( <span class="Type">this</span>, arguments );
<span class="lnr"> 7343 </span>       }
<span class="lnr"> 7344 </span>
<span class="lnr"> 7345 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 7346 </span>          <span class="Statement">if</span> ( bool ? state : isHidden( <span class="Type">this</span> ) ) {
<span class="lnr"> 7347 </span>             jQuery( <span class="Type">this</span> ).show();
<span class="lnr"> 7348 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 7349 </span>             jQuery( <span class="Type">this</span> ).hide();
<span class="lnr"> 7350 </span>          }
<span class="lnr"> 7351 </span>       });
<span class="lnr"> 7352 </span>    }
<span class="lnr"> 7353 </span>});
<span class="lnr"> 7354 </span>
<span class="lnr"> 7355 </span>jQuery.extend({
<span class="lnr"> 7356 </span><span class="Comment">    // Add in style property hooks for overriding the default</span>
<span class="lnr"> 7357 </span><span class="Comment">    // behavior of getting and setting a style property</span>
<span class="lnr"> 7358 </span>    <span class="Statement">cssHooks</span>: {
<span class="lnr"> 7359 </span>       <span class="Statement">opacity</span>: {
<span class="lnr"> 7360 </span>          <span class="Statement">get</span>: <span class="Identifier">function</span>( elem, computed ) {
<span class="lnr"> 7361 </span>             <span class="Statement">if</span> ( computed ) {
<span class="lnr"> 7362 </span><span class="Comment">                // We should always get a number back from opacity</span>
<span class="lnr"> 7363 </span>                <span class="Type">var</span> ret = curCSS( elem, <span class="Constant">&quot;opacity&quot;</span> );
<span class="lnr"> 7364 </span>                <span class="Statement">return</span> ret === <span class="Constant">&quot;&quot;</span> ? <span class="Constant">&quot;1&quot;</span> : ret;
<span class="lnr"> 7365 </span>
<span class="lnr"> 7366 </span>             }
<span class="lnr"> 7367 </span>          }
<span class="lnr"> 7368 </span>       }
<span class="lnr"> 7369 </span>    },
<span class="lnr"> 7370 </span>
<span class="lnr"> 7371 </span><span class="Comment">    // Exclude the following css properties to add px</span>
<span class="lnr"> 7372 </span>    <span class="Statement">cssNumber</span>: {
<span class="lnr"> 7373 </span>       <span class="Constant">&quot;fillOpacity&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 7374 </span>       <span class="Constant">&quot;fontWeight&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 7375 </span>       <span class="Constant">&quot;lineHeight&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 7376 </span>       <span class="Constant">&quot;opacity&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 7377 </span>       <span class="Constant">&quot;orphans&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 7378 </span>       <span class="Constant">&quot;widows&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 7379 </span>       <span class="Constant">&quot;zIndex&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 7380 </span>       <span class="Constant">&quot;zoom&quot;</span>: <span class="Constant">true</span>
<span class="lnr"> 7381 </span>    },
<span class="lnr"> 7382 </span>
<span class="lnr"> 7383 </span><span class="Comment">    // Add in properties whose names you wish to fix before</span>
<span class="lnr"> 7384 </span><span class="Comment">    // setting or getting the value</span>
<span class="lnr"> 7385 </span>    <span class="Statement">cssProps</span>: {
<span class="lnr"> 7386 </span><span class="Comment">       // normalize float css property</span>
<span class="lnr"> 7387 </span>       <span class="Constant">&quot;float&quot;</span>: jQuery.support.cssFloat ? <span class="Constant">&quot;cssFloat&quot;</span> : <span class="Constant">&quot;styleFloat&quot;</span>
<span class="lnr"> 7388 </span>    },
<span class="lnr"> 7389 </span>
<span class="lnr"> 7390 </span><span class="Comment">    // Get and set the style property on a DOM Node</span>
<span class="lnr"> 7391 </span>    <span class="Statement">style</span>: <span class="Identifier">function</span>( elem, name, value, extra ) {
<span class="lnr"> 7392 </span><span class="Comment">       // Don't set styles on text and comment nodes</span>
<span class="lnr"> 7393 </span>       <span class="Statement">if</span> ( !elem || elem.nodeType === <span class="Constant">3</span> || elem.nodeType === <span class="Constant">8</span> || !elem.style ) {
<span class="lnr"> 7394 </span>          <span class="Statement">return</span>;
<span class="lnr"> 7395 </span>       }
<span class="lnr"> 7396 </span>
<span class="lnr"> 7397 </span><span class="Comment">       // Make sure that we're working with the right name</span>
<span class="lnr"> 7398 </span>       <span class="Type">var</span> ret, type, hooks,
<span class="lnr"> 7399 </span>          origName = jQuery.camelCase( name ),
<span class="lnr"> 7400 </span>          style = elem.style;
<span class="lnr"> 7401 </span>
<span class="lnr"> 7402 </span>       name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
<span class="lnr"> 7403 </span>
<span class="lnr"> 7404 </span><span class="Comment">       // gets hook for the prefixed version</span>
<span class="lnr"> 7405 </span><span class="Comment">       // followed by the unprefixed version</span>
<span class="lnr"> 7406 </span>       hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
<span class="lnr"> 7407 </span>
<span class="lnr"> 7408 </span><span class="Comment">       // Check if we're setting a value</span>
<span class="lnr"> 7409 </span>       <span class="Statement">if</span> ( value !== <span class="Type">undefined</span> ) {
<span class="lnr"> 7410 </span>          type = <span class="Statement">typeof</span> value;
<span class="lnr"> 7411 </span>
<span class="lnr"> 7412 </span><span class="Comment">          // convert relative number strings (+= or -=) to relative numbers. #7345</span>
<span class="lnr"> 7413 </span>          <span class="Statement">if</span> ( type === <span class="Constant">&quot;string&quot;</span> &amp;&amp; (ret = rrelNum.exec( value )) ) {
<span class="lnr"> 7414 </span>             value = ( ret[<span class="Constant">1</span>] + <span class="Constant">1</span> ) * ret[<span class="Constant">2</span>] + parseFloat( jQuery.css( elem, name ) );
<span class="lnr"> 7415 </span><span class="Comment">             // Fixes bug #9237</span>
<span class="lnr"> 7416 </span>             type = <span class="Constant">&quot;number&quot;</span>;
<span class="lnr"> 7417 </span>          }
<span class="lnr"> 7418 </span>
<span class="lnr"> 7419 </span><span class="Comment">          // Make sure that NaN and null values aren't set. See: #7116</span>
<span class="lnr"> 7420 </span>          <span class="Statement">if</span> ( value == <span class="Type">null</span> || type === <span class="Constant">&quot;number&quot;</span> &amp;&amp; isNaN( value ) ) {
<span class="lnr"> 7421 </span>             <span class="Statement">return</span>;
<span class="lnr"> 7422 </span>          }
<span class="lnr"> 7423 </span>
<span class="lnr"> 7424 </span><span class="Comment">          // If a number was passed in, add 'px' to the (except for certain CSS properties)</span>
<span class="lnr"> 7425 </span>          <span class="Statement">if</span> ( type === <span class="Constant">&quot;number&quot;</span> &amp;&amp; !jQuery.cssNumber[ origName ] ) {
<span class="lnr"> 7426 </span>             value += <span class="Constant">&quot;px&quot;</span>;
<span class="lnr"> 7427 </span>          }
<span class="lnr"> 7428 </span>
<span class="lnr"> 7429 </span><span class="Comment">          // If a hook was provided, use that value, otherwise just set the specified value</span>
<span class="lnr"> 7430 </span>          <span class="Statement">if</span> ( !hooks || !(<span class="Constant">&quot;set&quot;</span> <span class="Statement">in</span> hooks) || (value = hooks.set( elem, value, extra )) !== <span class="Type">undefined</span> ) {
<span class="lnr"> 7431 </span><span class="Comment">             // Wrapped to prevent IE from throwing errors when 'invalid' values are provided</span>
<span class="lnr"> 7432 </span><span class="Comment">             // Fixes bug #5509</span>
<span class="lnr"> 7433 </span>             <span class="Statement">try</span> {
<span class="lnr"> 7434 </span>                style[ name ] = value;
<span class="lnr"> 7435 </span>             } <span class="Statement">catch</span>(e) {}
<span class="lnr"> 7436 </span>          }
<span class="lnr"> 7437 </span>
<span class="lnr"> 7438 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 7439 </span><span class="Comment">          // If a hook was provided get the non-computed value from there</span>
<span class="lnr"> 7440 </span>          <span class="Statement">if</span> ( hooks &amp;&amp; <span class="Constant">&quot;get&quot;</span> <span class="Statement">in</span> hooks &amp;&amp; (ret = hooks.get( elem, <span class="Constant">false</span>, extra )) !== <span class="Type">undefined</span> ) {
<span class="lnr"> 7441 </span>             <span class="Statement">return</span> ret;
<span class="lnr"> 7442 </span>          }
<span class="lnr"> 7443 </span>
<span class="lnr"> 7444 </span><span class="Comment">          // Otherwise just get the value from the style object</span>
<span class="lnr"> 7445 </span>          <span class="Statement">return</span> style[ name ];
<span class="lnr"> 7446 </span>       }
<span class="lnr"> 7447 </span>    },
<span class="lnr"> 7448 </span>
<span class="lnr"> 7449 </span>    <span class="Statement">css</span>: <span class="Identifier">function</span>( elem, name, numeric, extra ) {
<span class="lnr"> 7450 </span>       <span class="Type">var</span> val, num, hooks,
<span class="lnr"> 7451 </span>          origName = jQuery.camelCase( name );
<span class="lnr"> 7452 </span>
<span class="lnr"> 7453 </span><span class="Comment">       // Make sure that we're working with the right name</span>
<span class="lnr"> 7454 </span>       name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
<span class="lnr"> 7455 </span>
<span class="lnr"> 7456 </span><span class="Comment">       // gets hook for the prefixed version</span>
<span class="lnr"> 7457 </span><span class="Comment">       // followed by the unprefixed version</span>
<span class="lnr"> 7458 </span>       hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
<span class="lnr"> 7459 </span>
<span class="lnr"> 7460 </span><span class="Comment">       // If a hook was provided get the computed value from there</span>
<span class="lnr"> 7461 </span>       <span class="Statement">if</span> ( hooks &amp;&amp; <span class="Constant">&quot;get&quot;</span> <span class="Statement">in</span> hooks ) {
<span class="lnr"> 7462 </span>          val = hooks.get( elem, <span class="Constant">true</span>, extra );
<span class="lnr"> 7463 </span>       }
<span class="lnr"> 7464 </span>
<span class="lnr"> 7465 </span><span class="Comment">       // Otherwise, if a way to get the computed value exists, use that</span>
<span class="lnr"> 7466 </span>       <span class="Statement">if</span> ( val === <span class="Type">undefined</span> ) {
<span class="lnr"> 7467 </span>          val = curCSS( elem, name );
<span class="lnr"> 7468 </span>       }
<span class="lnr"> 7469 </span>
<span class="lnr"> 7470 </span><span class="Comment">       //convert &quot;normal&quot; to computed value</span>
<span class="lnr"> 7471 </span>       <span class="Statement">if</span> ( val === <span class="Constant">&quot;normal&quot;</span> &amp;&amp; name <span class="Statement">in</span> cssNormalTransform ) {
<span class="lnr"> 7472 </span>          val = cssNormalTransform[ name ];
<span class="lnr"> 7473 </span>       }
<span class="lnr"> 7474 </span>
<span class="lnr"> 7475 </span><span class="Comment">       // Return, converting to number if forced or a qualifier was provided and val looks numeric</span>
<span class="lnr"> 7476 </span>       <span class="Statement">if</span> ( numeric || extra !== <span class="Type">undefined</span> ) {
<span class="lnr"> 7477 </span>          num = parseFloat( val );
<span class="lnr"> 7478 </span>          <span class="Statement">return</span> numeric || jQuery.isNumeric( num ) ? num || <span class="Statement">0</span> : val;
<span class="lnr"> 7479 </span>       }
<span class="lnr"> 7480 </span>       <span class="Statement">return</span> val;
<span class="lnr"> 7481 </span>    },
<span class="lnr"> 7482 </span>
<span class="lnr"> 7483 </span><span class="Comment">    // A method for quickly swapping in/out CSS properties to get correct calculations</span>
<span class="lnr"> 7484 </span>    <span class="Statement">swap</span>: <span class="Identifier">function</span>( elem, options, callback ) {
<span class="lnr"> 7485 </span>       <span class="Type">var</span> ret, name,
<span class="lnr"> 7486 </span>          old = {};
<span class="lnr"> 7487 </span>
<span class="lnr"> 7488 </span><span class="Comment">       // Remember the old values, and insert the new ones</span>
<span class="lnr"> 7489 </span>       <span class="Statement">for</span> ( name <span class="Statement">in</span> options ) {
<span class="lnr"> 7490 </span>          old[ name ] = elem.style[ name ];
<span class="lnr"> 7491 </span>          elem.style[ name ] = options[ name ];
<span class="lnr"> 7492 </span>       }
<span class="lnr"> 7493 </span>
<span class="lnr"> 7494 </span>       ret = callback.call( elem );
<span class="lnr"> 7495 </span>
<span class="lnr"> 7496 </span><span class="Comment">       // Revert the old values</span>
<span class="lnr"> 7497 </span>       <span class="Statement">for</span> ( name <span class="Statement">in</span> options ) {
<span class="lnr"> 7498 </span>          elem.style[ name ] = old[ name ];
<span class="lnr"> 7499 </span>       }
<span class="lnr"> 7500 </span>
<span class="lnr"> 7501 </span>       <span class="Statement">return</span> ret;
<span class="lnr"> 7502 </span>    }
<span class="lnr"> 7503 </span>});
<span class="lnr"> 7504 </span>
<span class="lnr"> 7505 </span><span class="Comment">// NOTE: To any future maintainer, we've window.getComputedStyle</span>
<span class="lnr"> 7506 </span><span class="Comment">// because jsdom on node.js will break without it.</span>
<span class="lnr"> 7507 </span><span class="Statement">if</span> ( window.getComputedStyle ) {
<span class="lnr"> 7508 </span>    curCSS = <span class="Identifier">function</span>( elem, name ) {
<span class="lnr"> 7509 </span>       <span class="Type">var</span> ret, width, minWidth, maxWidth,
<span class="lnr"> 7510 </span>          computed = window.getComputedStyle( elem, <span class="Type">null</span> ),
<span class="lnr"> 7511 </span>          style = elem.style;
<span class="lnr"> 7512 </span>
<span class="lnr"> 7513 </span>       <span class="Statement">if</span> ( computed ) {
<span class="lnr"> 7514 </span>
<span class="lnr"> 7515 </span>          ret = computed[ name ];
<span class="lnr"> 7516 </span>          <span class="Statement">if</span> ( ret === <span class="Constant">&quot;&quot;</span> &amp;&amp; !jQuery.contains( elem.ownerDocument, elem ) ) {
<span class="lnr"> 7517 </span>             ret = jQuery.style( elem, name );
<span class="lnr"> 7518 </span>          }
<span class="lnr"> 7519 </span>
<span class="lnr"> 7520 </span><span class="Comment">          // A tribute to the &quot;awesome hack by Dean Edwards&quot;</span>
<span class="lnr"> 7521 </span><span class="Comment">          // Chrome &lt; 17 and Safari 5.0 uses &quot;computed value&quot; instead of &quot;used value&quot; for margin-right</span>
<span class="lnr"> 7522 </span><span class="Comment">          // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels</span>
<span class="lnr"> 7523 </span><span class="Comment">          // this is against the CSSOM draft spec: <a href="http://dev.w3.org/csswg/cssom/#resolved-values">http://dev.w3.org/csswg/cssom/#resolved-values</a></span>
<span class="lnr"> 7524 </span>          <span class="Statement">if</span> ( rnumnonpx.test( ret ) &amp;&amp; rmargin.test( name ) ) {
<span class="lnr"> 7525 </span>             width = style.width;
<span class="lnr"> 7526 </span>             minWidth = style.minWidth;
<span class="lnr"> 7527 </span>             maxWidth = style.maxWidth;
<span class="lnr"> 7528 </span>
<span class="lnr"> 7529 </span>             style.minWidth = style.maxWidth = style.width = ret;
<span class="lnr"> 7530 </span>             ret = computed.width;
<span class="lnr"> 7531 </span>
<span class="lnr"> 7532 </span>             style.width = width;
<span class="lnr"> 7533 </span>             style.minWidth = minWidth;
<span class="lnr"> 7534 </span>             style.maxWidth = maxWidth;
<span class="lnr"> 7535 </span>          }
<span class="lnr"> 7536 </span>       }
<span class="lnr"> 7537 </span>
<span class="lnr"> 7538 </span>       <span class="Statement">return</span> ret;
<span class="lnr"> 7539 </span>    };
<span class="lnr"> 7540 </span>} <span class="Statement">else</span> <span class="Statement">if</span> ( document.documentElement.currentStyle ) {
<span class="lnr"> 7541 </span>    curCSS = <span class="Identifier">function</span>( elem, name ) {
<span class="lnr"> 7542 </span>       <span class="Type">var</span> left, rsLeft,
<span class="lnr"> 7543 </span>          ret = elem.currentStyle &amp;&amp; elem.currentStyle[ name ],
<span class="lnr"> 7544 </span>          style = elem.style;
<span class="lnr"> 7545 </span>
<span class="lnr"> 7546 </span><span class="Comment">       // Avoid setting ret to empty string here</span>
<span class="lnr"> 7547 </span><span class="Comment">       // so we don't default to auto</span>
<span class="lnr"> 7548 </span>       <span class="Statement">if</span> ( ret == <span class="Type">null</span> &amp;&amp; style &amp;&amp; style[ name ] ) {
<span class="lnr"> 7549 </span>          ret = style[ name ];
<span class="lnr"> 7550 </span>       }
<span class="lnr"> 7551 </span>
<span class="lnr"> 7552 </span><span class="Comment">       // From the awesome hack by Dean Edwards</span>
<span class="lnr"> 7553 </span><span class="Comment">       // <a href="http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291">http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291</a></span>
<span class="lnr"> 7554 </span>
<span class="lnr"> 7555 </span><span class="Comment">       // If we're not dealing with a regular pixel number</span>
<span class="lnr"> 7556 </span><span class="Comment">       // but a number that has a weird ending, we need to convert it to pixels</span>
<span class="lnr"> 7557 </span><span class="Comment">       // but not position css attributes, as those are proportional to the parent element instead</span>
<span class="lnr"> 7558 </span><span class="Comment">       // and we can't measure the parent instead because it might trigger a &quot;stacking dolls&quot; problem</span>
<span class="lnr"> 7559 </span>       <span class="Statement">if</span> ( rnumnonpx.test( ret ) &amp;&amp; !rposition.test( name ) ) {
<span class="lnr"> 7560 </span>
<span class="lnr"> 7561 </span><span class="Comment">          // Remember the original values</span>
<span class="lnr"> 7562 </span>          left = style.left;
<span class="lnr"> 7563 </span>          rsLeft = elem.runtimeStyle &amp;&amp; elem.runtimeStyle.left;
<span class="lnr"> 7564 </span>
<span class="lnr"> 7565 </span><span class="Comment">          // Put in the new values to get a computed value out</span>
<span class="lnr"> 7566 </span>          <span class="Statement">if</span> ( rsLeft ) {
<span class="lnr"> 7567 </span>             elem.runtimeStyle.left = elem.currentStyle.left;
<span class="lnr"> 7568 </span>          }
<span class="lnr"> 7569 </span>          style.left = name === <span class="Constant">&quot;fontSize&quot;</span> ? <span class="Constant">&quot;1em&quot;</span> : ret;
<span class="lnr"> 7570 </span>          ret = style.pixelLeft + <span class="Constant">&quot;px&quot;</span>;
<span class="lnr"> 7571 </span>
<span class="lnr"> 7572 </span><span class="Comment">          // Revert the changed values</span>
<span class="lnr"> 7573 </span>          style.left = left;
<span class="lnr"> 7574 </span>          <span class="Statement">if</span> ( rsLeft ) {
<span class="lnr"> 7575 </span>             elem.runtimeStyle.left = rsLeft;
<span class="lnr"> 7576 </span>          }
<span class="lnr"> 7577 </span>       }
<span class="lnr"> 7578 </span>
<span class="lnr"> 7579 </span>       <span class="Statement">return</span> ret === <span class="Constant">&quot;&quot;</span> ? <span class="Constant">&quot;auto&quot;</span> : ret;
<span class="lnr"> 7580 </span>    };
<span class="lnr"> 7581 </span>}
<span class="lnr"> 7582 </span>
<span class="lnr"> 7583 </span><span class="Identifier">function</span> setPositiveNumber( elem, value, subtract ) {
<span class="lnr"> 7584 </span>    <span class="Type">var</span> matches = rnumsplit.exec( value );
<span class="lnr"> 7585 </span>    <span class="Statement">return</span> matches ?
<span class="lnr"> 7586 </span>          <span class="Special">Math</span>.max( <span class="Constant">0</span>, matches[ <span class="Constant">1</span> ] - ( subtract || <span class="Constant">0</span> ) ) + ( matches[ <span class="Constant">2</span> ] || <span class="Constant">&quot;px&quot;</span> ) :
<span class="lnr"> 7587 </span>          value;
<span class="lnr"> 7588 </span>}
<span class="lnr"> 7589 </span>
<span class="lnr"> 7590 </span><span class="Identifier">function</span> augmentWidthOrHeight( elem, name, extra, isBorderBox ) {
<span class="lnr"> 7591 </span>    <span class="Type">var</span> i = extra === ( isBorderBox ? <span class="Constant">&quot;border&quot;</span> : <span class="Constant">&quot;content&quot;</span> ) ?
<span class="lnr"> 7592 </span><span class="Comment">       // If we already have the right measurement, avoid augmentation</span>
<span class="lnr"> 7593 </span>       <span class="Statement">4</span> :
<span class="lnr"> 7594 </span><span class="Comment">       // Otherwise initialize for horizontal or vertical properties</span>
<span class="lnr"> 7595 </span>       name === <span class="Constant">&quot;width&quot;</span> ? <span class="Constant">1</span> : <span class="Constant">0</span>,
<span class="lnr"> 7596 </span>
<span class="lnr"> 7597 </span>       val = <span class="Constant">0</span>;
<span class="lnr"> 7598 </span>
<span class="lnr"> 7599 </span>    <span class="Statement">for</span> ( ; i &lt; <span class="Constant">4</span>; i += <span class="Constant">2</span> ) {
<span class="lnr"> 7600 </span><span class="Comment">       // both box models exclude margin, so add it if we want it</span>
<span class="lnr"> 7601 </span>       <span class="Statement">if</span> ( extra === <span class="Constant">&quot;margin&quot;</span> ) {
<span class="lnr"> 7602 </span><span class="Comment">          // we use jQuery.css instead of curCSS here</span>
<span class="lnr"> 7603 </span><span class="Comment">          // because of the reliableMarginRight CSS hook!</span>
<span class="lnr"> 7604 </span>          val += jQuery.css( elem, extra + cssExpand[ i ], <span class="Constant">true</span> );
<span class="lnr"> 7605 </span>       }
<span class="lnr"> 7606 </span>
<span class="lnr"> 7607 </span><span class="Comment">       // From this point on we use curCSS for maximum performance (relevant in animations)</span>
<span class="lnr"> 7608 </span>       <span class="Statement">if</span> ( isBorderBox ) {
<span class="lnr"> 7609 </span><span class="Comment">          // border-box includes padding, so remove it if we want content</span>
<span class="lnr"> 7610 </span>          <span class="Statement">if</span> ( extra === <span class="Constant">&quot;content&quot;</span> ) {
<span class="lnr"> 7611 </span>             val -= parseFloat( curCSS( elem, <span class="Constant">&quot;padding&quot;</span> + cssExpand[ i ] ) ) || <span class="Constant">0</span>;
<span class="lnr"> 7612 </span>          }
<span class="lnr"> 7613 </span>
<span class="lnr"> 7614 </span><span class="Comment">          // at this point, extra isn't border nor margin, so remove border</span>
<span class="lnr"> 7615 </span>          <span class="Statement">if</span> ( extra !== <span class="Constant">&quot;margin&quot;</span> ) {
<span class="lnr"> 7616 </span>             val -= parseFloat( curCSS( elem, <span class="Constant">&quot;border&quot;</span> + cssExpand[ i ] + <span class="Constant">&quot;Width&quot;</span> ) ) || <span class="Constant">0</span>;
<span class="lnr"> 7617 </span>          }
<span class="lnr"> 7618 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 7619 </span><span class="Comment">          // at this point, extra isn't content, so add padding</span>
<span class="lnr"> 7620 </span>          val += parseFloat( curCSS( elem, <span class="Constant">&quot;padding&quot;</span> + cssExpand[ i ] ) ) || <span class="Constant">0</span>;
<span class="lnr"> 7621 </span>
<span class="lnr"> 7622 </span><span class="Comment">          // at this point, extra isn't content nor padding, so add border</span>
<span class="lnr"> 7623 </span>          <span class="Statement">if</span> ( extra !== <span class="Constant">&quot;padding&quot;</span> ) {
<span class="lnr"> 7624 </span>             val += parseFloat( curCSS( elem, <span class="Constant">&quot;border&quot;</span> + cssExpand[ i ] + <span class="Constant">&quot;Width&quot;</span> ) ) || <span class="Constant">0</span>;
<span class="lnr"> 7625 </span>          }
<span class="lnr"> 7626 </span>       }
<span class="lnr"> 7627 </span>    }
<span class="lnr"> 7628 </span>
<span class="lnr"> 7629 </span>    <span class="Statement">return</span> val;
<span class="lnr"> 7630 </span>}
<span class="lnr"> 7631 </span>
<span class="lnr"> 7632 </span><span class="Identifier">function</span> getWidthOrHeight( elem, name, extra ) {
<span class="lnr"> 7633 </span>
<span class="lnr"> 7634 </span><span class="Comment">    // Start with offset property, which is equivalent to the border-box value</span>
<span class="lnr"> 7635 </span>    <span class="Type">var</span> val = name === <span class="Constant">&quot;width&quot;</span> ? elem.<span class="Statement">offsetWidth</span> : elem.offsetHeight,
<span class="lnr"> 7636 </span>       valueIsBorderBox = <span class="Constant">true</span>,
<span class="lnr"> 7637 </span>       isBorderBox = jQuery.support.boxSizing &amp;&amp; jQuery.css( elem, <span class="Constant">&quot;boxSizing&quot;</span> ) === <span class="Constant">&quot;border-box&quot;</span>;
<span class="lnr"> 7638 </span>
<span class="lnr"> 7639 </span><span class="Comment">    // some non-html elements return undefined for offsetWidth, so check for null/undefined</span>
<span class="lnr"> 7640 </span><span class="Comment">    // svg - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=649285">https://bugzilla.mozilla.org/show_bug.cgi?id=649285</a></span>
<span class="lnr"> 7641 </span><span class="Comment">    // MathML - <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=491668">https://bugzilla.mozilla.org/show_bug.cgi?id=491668</a></span>
<span class="lnr"> 7642 </span>    <span class="Statement">if</span> ( val &lt;= <span class="Constant">0</span> || val == <span class="Type">null</span> ) {
<span class="lnr"> 7643 </span><span class="Comment">       // Fall back to computed then uncomputed css if necessary</span>
<span class="lnr"> 7644 </span>       val = curCSS( elem, name );
<span class="lnr"> 7645 </span>       <span class="Statement">if</span> ( val &lt; <span class="Constant">0</span> || val == <span class="Type">null</span> ) {
<span class="lnr"> 7646 </span>          val = elem.style[ name ];
<span class="lnr"> 7647 </span>       }
<span class="lnr"> 7648 </span>
<span class="lnr"> 7649 </span><span class="Comment">       // Computed unit is not pixels. Stop here and return.</span>
<span class="lnr"> 7650 </span>       <span class="Statement">if</span> ( rnumnonpx.test(val) ) {
<span class="lnr"> 7651 </span>          <span class="Statement">return</span> val;
<span class="lnr"> 7652 </span>       }
<span class="lnr"> 7653 </span>
<span class="lnr"> 7654 </span><span class="Comment">       // we need the check for style in case a browser which returns unreliable values</span>
<span class="lnr"> 7655 </span><span class="Comment">       // for getComputedStyle silently falls back to the reliable elem.style</span>
<span class="lnr"> 7656 </span>       valueIsBorderBox = isBorderBox &amp;&amp; ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
<span class="lnr"> 7657 </span>
<span class="lnr"> 7658 </span><span class="Comment">       // Normalize &quot;&quot;, auto, and prepare for extra</span>
<span class="lnr"> 7659 </span>       val = parseFloat( val ) || <span class="Constant">0</span>;
<span class="lnr"> 7660 </span>    }
<span class="lnr"> 7661 </span>
<span class="lnr"> 7662 </span><span class="Comment">    // use the active box-sizing model to add/subtract irrelevant styles</span>
<span class="lnr"> 7663 </span>    <span class="Statement">return</span> ( val +
<span class="lnr"> 7664 </span>       augmentWidthOrHeight(
<span class="lnr"> 7665 </span>          elem,
<span class="lnr"> 7666 </span>          name,
<span class="lnr"> 7667 </span>          extra || ( isBorderBox ? <span class="Constant">&quot;border&quot;</span> : <span class="Constant">&quot;content&quot;</span> ),
<span class="lnr"> 7668 </span>          valueIsBorderBox
<span class="lnr"> 7669 </span>       )
<span class="lnr"> 7670 </span>    ) + <span class="Constant">&quot;px&quot;</span>;
<span class="lnr"> 7671 </span>}
<span class="lnr"> 7672 </span>
<span class="lnr"> 7673 </span>
<span class="lnr"> 7674 </span><span class="Comment">// Try to determine the default display value of an element</span>
<span class="lnr"> 7675 </span><span class="Identifier">function</span> css_defaultDisplay( nodeName ) {
<span class="lnr"> 7676 </span>    <span class="Statement">if</span> ( elemdisplay[ nodeName ] ) {
<span class="lnr"> 7677 </span>       <span class="Statement">return</span> elemdisplay[ nodeName ];
<span class="lnr"> 7678 </span>    }
<span class="lnr"> 7679 </span>
<span class="lnr"> 7680 </span>    <span class="Type">var</span> elem = jQuery( <span class="Constant">&quot;&lt;&quot;</span> + nodeName + <span class="Constant">&quot;&gt;&quot;</span> ).appendTo( document.body ),
<span class="lnr"> 7681 </span>       display = elem.css(<span class="Constant">&quot;display&quot;</span>);
<span class="lnr"> 7682 </span>    elem.remove();
<span class="lnr"> 7683 </span>
<span class="lnr"> 7684 </span><span class="Comment">    // If the simple way fails,</span>
<span class="lnr"> 7685 </span><span class="Comment">    // get element's real default display by attaching it to a temp iframe</span>
<span class="lnr"> 7686 </span>    <span class="Statement">if</span> ( display === <span class="Constant">&quot;none&quot;</span> || display === <span class="Constant">&quot;&quot;</span> ) {
<span class="lnr"> 7687 </span><span class="Comment">       // Use the already-created iframe if possible</span>
<span class="lnr"> 7688 </span>       iframe = document.body.appendChild(
<span class="lnr"> 7689 </span>          iframe || jQuery.extend( document.createElement(<span class="Constant">&quot;iframe&quot;</span>), {
<span class="lnr"> 7690 </span>             <span class="Statement">frameBorder</span>: <span class="Constant">0</span>,
<span class="lnr"> 7691 </span>             <span class="Statement">width</span>: <span class="Constant">0</span>,
<span class="lnr"> 7692 </span>             <span class="Statement">height</span>: <span class="Constant">0</span>
<span class="lnr"> 7693 </span>          })
<span class="lnr"> 7694 </span>       );
<span class="lnr"> 7695 </span>
<span class="lnr"> 7696 </span><span class="Comment">       // Create a cacheable copy of the iframe document on first call.</span>
<span class="lnr"> 7697 </span><span class="Comment">       // IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML</span>
<span class="lnr"> 7698 </span><span class="Comment">       // document to it; WebKit &amp; Firefox won't allow reusing the iframe document.</span>
<span class="lnr"> 7699 </span>       <span class="Statement">if</span> ( !iframeDoc || !iframe.createElement ) {
<span class="lnr"> 7700 </span>          iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
<span class="lnr"> 7701 </span>          iframeDoc.write(<span class="Constant">&quot;&lt;!doctype html&gt;&lt;html&gt;&lt;body&gt;&quot;</span>);
<span class="lnr"> 7702 </span>          iframeDoc.close();
<span class="lnr"> 7703 </span>       }
<span class="lnr"> 7704 </span>
<span class="lnr"> 7705 </span>       elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );
<span class="lnr"> 7706 </span>
<span class="lnr"> 7707 </span>       display = curCSS( elem, <span class="Constant">&quot;display&quot;</span> );
<span class="lnr"> 7708 </span>       document.body.removeChild( iframe );
<span class="lnr"> 7709 </span>    }
<span class="lnr"> 7710 </span>
<span class="lnr"> 7711 </span><span class="Comment">    // Store the correct default display</span>
<span class="lnr"> 7712 </span>    elemdisplay[ nodeName ] = display;
<span class="lnr"> 7713 </span>
<span class="lnr"> 7714 </span>    <span class="Statement">return</span> display;
<span class="lnr"> 7715 </span>}
<span class="lnr"> 7716 </span>
<span class="lnr"> 7717 </span>jQuery.each([ <span class="Constant">&quot;height&quot;</span>, <span class="Constant">&quot;width&quot;</span> ], <span class="Identifier">function</span>( i, name ) {
<span class="lnr"> 7718 </span>    jQuery.cssHooks[ name ] = {
<span class="lnr"> 7719 </span>       <span class="Statement">get</span>: <span class="Identifier">function</span>( elem, computed, extra ) {
<span class="lnr"> 7720 </span>          <span class="Statement">if</span> ( computed ) {
<span class="lnr"> 7721 </span><span class="Comment">             // certain elements can have dimension info if we invisibly show them</span>
<span class="lnr"> 7722 </span><span class="Comment">             // however, it must have a current display style that would benefit from this</span>
<span class="lnr"> 7723 </span>             <span class="Statement">if</span> ( elem.offsetWidth === <span class="Constant">0</span> &amp;&amp; rdisplayswap.test( curCSS( elem, <span class="Constant">&quot;display&quot;</span> ) ) ) {
<span class="lnr"> 7724 </span>                <span class="Statement">return</span> jQuery.swap( elem, cssShow, <span class="Identifier">function</span>() {
<span class="lnr"> 7725 </span>                   <span class="Statement">return</span> getWidthOrHeight( elem, name, extra );
<span class="lnr"> 7726 </span>                });
<span class="lnr"> 7727 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 7728 </span>                <span class="Statement">return</span> getWidthOrHeight( elem, name, extra );
<span class="lnr"> 7729 </span>             }
<span class="lnr"> 7730 </span>          }
<span class="lnr"> 7731 </span>       },
<span class="lnr"> 7732 </span>
<span class="lnr"> 7733 </span>       <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value, extra ) {
<span class="lnr"> 7734 </span>          <span class="Statement">return</span> setPositiveNumber( elem, value, extra ?
<span class="lnr"> 7735 </span>             augmentWidthOrHeight(
<span class="lnr"> 7736 </span>                elem,
<span class="lnr"> 7737 </span>                name,
<span class="lnr"> 7738 </span>                extra,
<span class="lnr"> 7739 </span>                jQuery.support.boxSizing &amp;&amp; jQuery.css( elem, <span class="Constant">&quot;boxSizing&quot;</span> ) === <span class="Constant">&quot;border-box&quot;</span>
<span class="lnr"> 7740 </span>             ) : <span class="Constant">0</span>
<span class="lnr"> 7741 </span>          );
<span class="lnr"> 7742 </span>       }
<span class="lnr"> 7743 </span>    };
<span class="lnr"> 7744 </span>});
<span class="lnr"> 7745 </span>
<span class="lnr"> 7746 </span><span class="Statement">if</span> ( !jQuery.support.opacity ) {
<span class="lnr"> 7747 </span>    jQuery.cssHooks.opacity = {
<span class="lnr"> 7748 </span>       <span class="Statement">get</span>: <span class="Identifier">function</span>( elem, computed ) {
<span class="lnr"> 7749 </span><span class="Comment">          // IE uses filters for opacity</span>
<span class="lnr"> 7750 </span>          <span class="Statement">return</span> ropacity.test( (computed &amp;&amp; elem.currentStyle ? elem.currentStyle.<span class="Statement">filter</span> : elem.style.filter) || <span class="Constant">&quot;&quot;</span> ) ?
<span class="lnr"> 7751 </span>             ( <span class="Constant">0.01</span> * parseFloat( <span class="Special">RegExp</span>.$1 ) ) + <span class="Constant">&quot;&quot;</span> :
<span class="lnr"> 7752 </span>             computed ? <span class="Constant">&quot;1&quot;</span> : <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 7753 </span>       },
<span class="lnr"> 7754 </span>
<span class="lnr"> 7755 </span>       <span class="Statement">set</span>: <span class="Identifier">function</span>( elem, value ) {
<span class="lnr"> 7756 </span>          <span class="Type">var</span> style = elem.style,
<span class="lnr"> 7757 </span>             currentStyle = elem.currentStyle,
<span class="lnr"> 7758 </span>             opacity = jQuery.isNumeric( value ) ? <span class="Constant">&quot;alpha(opacity=&quot;</span> + value * <span class="Constant">100</span> + <span class="Constant">&quot;)&quot;</span> : <span class="Constant">&quot;&quot;</span>,
<span class="lnr"> 7759 </span>             filter = currentStyle &amp;&amp; currentStyle.filter || style.filter || <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 7760 </span>
<span class="lnr"> 7761 </span><span class="Comment">          // IE has trouble with opacity if it does not have layout</span>
<span class="lnr"> 7762 </span><span class="Comment">          // Force it by setting the zoom level</span>
<span class="lnr"> 7763 </span>          style.zoom = <span class="Constant">1</span>;
<span class="lnr"> 7764 </span>
<span class="lnr"> 7765 </span><span class="Comment">          // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652</span>
<span class="lnr"> 7766 </span>          <span class="Statement">if</span> ( value &gt;= <span class="Constant">1</span> &amp;&amp; jQuery.trim( filter.replace( ralpha, <span class="Constant">&quot;&quot;</span> ) ) === <span class="Constant">&quot;&quot;</span> &amp;&amp;
<span class="lnr"> 7767 </span>             style.removeAttribute ) {
<span class="lnr"> 7768 </span>
<span class="lnr"> 7769 </span><span class="Comment">             // Setting style.filter to null, &quot;&quot; &amp; &quot; &quot; still leave &quot;filter:&quot; in the cssText</span>
<span class="lnr"> 7770 </span><span class="Comment">             // if &quot;filter:&quot; is present at all, clearType is disabled, we want to avoid this</span>
<span class="lnr"> 7771 </span><span class="Comment">             // style.removeAttribute is IE Only, but so apparently is this code path...</span>
<span class="lnr"> 7772 </span>             style.removeAttribute( <span class="Constant">&quot;filter&quot;</span> );
<span class="lnr"> 7773 </span>
<span class="lnr"> 7774 </span><span class="Comment">             // if there there is no filter style applied in a css rule, we are done</span>
<span class="lnr"> 7775 </span>             <span class="Statement">if</span> ( currentStyle &amp;&amp; !currentStyle.filter ) {
<span class="lnr"> 7776 </span>                <span class="Statement">return</span>;
<span class="lnr"> 7777 </span>             }
<span class="lnr"> 7778 </span>          }
<span class="lnr"> 7779 </span>
<span class="lnr"> 7780 </span><span class="Comment">          // otherwise, set new filter values</span>
<span class="lnr"> 7781 </span>          style.filter = ralpha.test( filter ) ?
<span class="lnr"> 7782 </span>             filter.replace( ralpha, opacity ) :
<span class="lnr"> 7783 </span>             filter + <span class="Constant">&quot; &quot;</span> + opacity;
<span class="lnr"> 7784 </span>       }
<span class="lnr"> 7785 </span>    };
<span class="lnr"> 7786 </span>}
<span class="lnr"> 7787 </span>
<span class="lnr"> 7788 </span><span class="Comment">// These hooks cannot be added until DOM ready because the support test</span>
<span class="lnr"> 7789 </span><span class="Comment">// for it is not run until after DOM ready</span>
<span class="lnr"> 7790 </span>jQuery(<span class="Identifier">function</span>() {
<span class="lnr"> 7791 </span>    <span class="Statement">if</span> ( !jQuery.support.reliableMarginRight ) {
<span class="lnr"> 7792 </span>       jQuery.cssHooks.marginRight = {
<span class="lnr"> 7793 </span>          <span class="Statement">get</span>: <span class="Identifier">function</span>( elem, computed ) {
<span class="lnr"> 7794 </span><span class="Comment">             // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right</span>
<span class="lnr"> 7795 </span><span class="Comment">             // Work around by temporarily setting element display to inline-block</span>
<span class="lnr"> 7796 </span>             <span class="Statement">return</span> jQuery.swap( elem, { <span class="Constant">&quot;display&quot;</span>: <span class="Constant">&quot;inline-block&quot;</span> }, <span class="Identifier">function</span>() {
<span class="lnr"> 7797 </span>                <span class="Statement">if</span> ( computed ) {
<span class="lnr"> 7798 </span>                   <span class="Statement">return</span> curCSS( elem, <span class="Constant">&quot;marginRight&quot;</span> );
<span class="lnr"> 7799 </span>                }
<span class="lnr"> 7800 </span>             });
<span class="lnr"> 7801 </span>          }
<span class="lnr"> 7802 </span>       };
<span class="lnr"> 7803 </span>    }
<span class="lnr"> 7804 </span>
<span class="lnr"> 7805 </span><span class="Comment">    // Webkit bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=29084">https://bugs.webkit.org/show_bug.cgi?id=29084</a></span>
<span class="lnr"> 7806 </span><span class="Comment">    // getComputedStyle returns percent when specified for top/left/bottom/right</span>
<span class="lnr"> 7807 </span><span class="Comment">    // rather than make the css module depend on the offset module, we just check for it here</span>
<span class="lnr"> 7808 </span>    <span class="Statement">if</span> ( !jQuery.support.pixelPosition &amp;&amp; jQuery.fn.position ) {
<span class="lnr"> 7809 </span>       jQuery.each( [ <span class="Constant">&quot;top&quot;</span>, <span class="Constant">&quot;left&quot;</span> ], <span class="Identifier">function</span>( i, prop ) {
<span class="lnr"> 7810 </span>          jQuery.cssHooks[ prop ] = {
<span class="lnr"> 7811 </span>             <span class="Statement">get</span>: <span class="Identifier">function</span>( elem, computed ) {
<span class="lnr"> 7812 </span>                <span class="Statement">if</span> ( computed ) {
<span class="lnr"> 7813 </span>                   <span class="Type">var</span> ret = curCSS( elem, prop );
<span class="lnr"> 7814 </span><span class="Comment">                   // if curCSS returns percentage, fallback to offset</span>
<span class="lnr"> 7815 </span>                   <span class="Statement">return</span> rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + <span class="Constant">&quot;px&quot;</span> : ret;
<span class="lnr"> 7816 </span>                }
<span class="lnr"> 7817 </span>             }
<span class="lnr"> 7818 </span>          };
<span class="lnr"> 7819 </span>       });
<span class="lnr"> 7820 </span>    }
<span class="lnr"> 7821 </span>
<span class="lnr"> 7822 </span>});
<span class="lnr"> 7823 </span>
<span class="lnr"> 7824 </span><span class="Statement">if</span> ( jQuery.expr &amp;&amp; jQuery.expr.filters ) {
<span class="lnr"> 7825 </span>    jQuery.expr.filters.hidden = <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 7826 </span>       <span class="Statement">return</span> ( elem.offsetWidth === <span class="Constant">0</span> &amp;&amp; elem.offsetHeight === <span class="Constant">0</span> ) || (!jQuery.support.reliableHiddenOffsets &amp;&amp; ((elem.style &amp;&amp; elem.style.display) || curCSS( elem, <span class="Constant">&quot;display&quot;</span> )) === <span class="Constant">&quot;none&quot;</span>);
<span class="lnr"> 7827 </span>    };
<span class="lnr"> 7828 </span>
<span class="lnr"> 7829 </span>    jQuery.expr.filters.visible = <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 7830 </span>       <span class="Statement">return</span> !jQuery.expr.filters.hidden( elem );
<span class="lnr"> 7831 </span>    };
<span class="lnr"> 7832 </span>}
<span class="lnr"> 7833 </span>
<span class="lnr"> 7834 </span><span class="Comment">// These hooks are used by animate to expand properties</span>
<span class="lnr"> 7835 </span>jQuery.each({
<span class="lnr"> 7836 </span>    <span class="Statement">margin</span>: <span class="Constant">&quot;&quot;</span>,
<span class="lnr"> 7837 </span>    <span class="Statement">padding</span>: <span class="Constant">&quot;&quot;</span>,
<span class="lnr"> 7838 </span>    <span class="Statement">border</span>: <span class="Constant">&quot;Width&quot;</span>
<span class="lnr"> 7839 </span>}, <span class="Identifier">function</span>( prefix, suffix ) {
<span class="lnr"> 7840 </span>    jQuery.cssHooks[ prefix + suffix ] = {
<span class="lnr"> 7841 </span>       <span class="Statement">expand</span>: <span class="Identifier">function</span>( value ) {
<span class="lnr"> 7842 </span>          <span class="Type">var</span> i,
<span class="lnr"> 7843 </span>
<span class="lnr"> 7844 </span><span class="Comment">             // assumes a single number if not a string</span>
<span class="lnr"> 7845 </span>             parts = <span class="Statement">typeof</span> value === <span class="Constant">&quot;string&quot;</span> ? value.split(<span class="Constant">&quot; &quot;</span>) : [ value ],
<span class="lnr"> 7846 </span>             expanded = {};
<span class="lnr"> 7847 </span>
<span class="lnr"> 7848 </span>          <span class="Statement">for</span> ( i = <span class="Constant">0</span>; i &lt; <span class="Constant">4</span>; i++ ) {
<span class="lnr"> 7849 </span>             expanded[ prefix + cssExpand[ i ] + suffix ] =
<span class="lnr"> 7850 </span>                parts[ i ] || parts[ i - <span class="Constant">2</span> ] || parts[ <span class="Constant">0</span> ];
<span class="lnr"> 7851 </span>          }
<span class="lnr"> 7852 </span>
<span class="lnr"> 7853 </span>          <span class="Statement">return</span> expanded;
<span class="lnr"> 7854 </span>       }
<span class="lnr"> 7855 </span>    };
<span class="lnr"> 7856 </span>
<span class="lnr"> 7857 </span>    <span class="Statement">if</span> ( !rmargin.test( prefix ) ) {
<span class="lnr"> 7858 </span>       jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
<span class="lnr"> 7859 </span>    }
<span class="lnr"> 7860 </span>});
<span class="lnr"> 7861 </span><span class="Type">var</span> r20 = <span class="Constant">/%20/g</span>,
<span class="lnr"> 7862 </span>    rbracket = <span class="Constant">/</span><span class="Special">\[\]</span><span class="Constant">$/</span>,
<span class="lnr"> 7863 </span>    rCRLF = <span class="Constant">/</span><span class="Special">\r</span><span class="Constant">?</span><span class="Special">\n</span><span class="Constant">/g</span>,
<span class="lnr"> 7864 </span>    rinput = <span class="Constant">/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i</span>,
<span class="lnr"> 7865 </span>    rselectTextarea = <span class="Constant">/^(?:select|textarea)/i</span>;
<span class="lnr"> 7866 </span>
<span class="lnr"> 7867 </span>jQuery.fn.extend({
<span class="lnr"> 7868 </span>    <span class="Statement">serialize</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 7869 </span>       <span class="Statement">return</span> jQuery.param( <span class="Type">this</span>.serializeArray() );
<span class="lnr"> 7870 </span>    },
<span class="lnr"> 7871 </span>    <span class="Statement">serializeArray</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 7872 </span>       <span class="Statement">return</span> <span class="Type">this</span>.map(<span class="Identifier">function</span>(){
<span class="lnr"> 7873 </span>          <span class="Statement">return</span> <span class="Type">this</span>.elements ? jQuery.makeArray( <span class="Type">this</span>.elements ) : <span class="Type">this</span>;
<span class="lnr"> 7874 </span>       })
<span class="lnr"> 7875 </span>       .filter(<span class="Identifier">function</span>(){
<span class="lnr"> 7876 </span>          <span class="Statement">return</span> <span class="Type">this</span>.name &amp;&amp; !<span class="Type">this</span>.disabled &amp;&amp;
<span class="lnr"> 7877 </span>             ( <span class="Type">this</span>.checked || rselectTextarea.test( <span class="Type">this</span>.nodeName ) ||
<span class="lnr"> 7878 </span>                rinput.test( <span class="Type">this</span>.type ) );
<span class="lnr"> 7879 </span>       })
<span class="lnr"> 7880 </span>       .map(<span class="Identifier">function</span>( i, elem ){
<span class="lnr"> 7881 </span>          <span class="Type">var</span> val = jQuery( <span class="Type">this</span> ).val();
<span class="lnr"> 7882 </span>
<span class="lnr"> 7883 </span>          <span class="Statement">return</span> val == <span class="Type">null</span> ?
<span class="lnr"> 7884 </span>             <span class="Type">null</span> :
<span class="lnr"> 7885 </span>             jQuery.isArray( val ) ?
<span class="lnr"> 7886 </span>                jQuery.map( val, <span class="Identifier">function</span>( val, i ){
<span class="lnr"> 7887 </span>                   <span class="Statement">return</span> { <span class="Statement">name</span>: elem.name, <span class="Statement">value</span>: val.replace( rCRLF, <span class="Constant">&quot;</span><span class="Special">\r\n</span><span class="Constant">&quot;</span> ) };
<span class="lnr"> 7888 </span>                }) :
<span class="lnr"> 7889 </span>                { <span class="Statement">name</span>: elem.name, <span class="Statement">value</span>: val.replace( rCRLF, <span class="Constant">&quot;</span><span class="Special">\r\n</span><span class="Constant">&quot;</span> ) };
<span class="lnr"> 7890 </span>       }).get();
<span class="lnr"> 7891 </span>    }
<span class="lnr"> 7892 </span>});
<span class="lnr"> 7893 </span>
<span class="lnr"> 7894 </span><span class="Comment">//Serialize an array of form elements or a set of</span>
<span class="lnr"> 7895 </span><span class="Comment">//key/values into a query string</span>
<span class="lnr"> 7896 </span>jQuery.param = <span class="Identifier">function</span>( a, traditional ) {
<span class="lnr"> 7897 </span>    <span class="Type">var</span> prefix,
<span class="lnr"> 7898 </span>       s = [],
<span class="lnr"> 7899 </span>       add = <span class="Identifier">function</span>( key, value ) {
<span class="lnr"> 7900 </span><span class="Comment">          // If value is a function, invoke it and return its value</span>
<span class="lnr"> 7901 </span>          value = jQuery.isFunction( value ) ? value() : ( value == <span class="Type">null</span> ? <span class="Constant">&quot;&quot;</span> : value );
<span class="lnr"> 7902 </span>          s[ s.length ] = encodeURIComponent( key ) + <span class="Constant">&quot;=&quot;</span> + encodeURIComponent( value );
<span class="lnr"> 7903 </span>       };
<span class="lnr"> 7904 </span>
<span class="lnr"> 7905 </span><span class="Comment">    // Set traditional to true for jQuery &lt;= 1.3.2 behavior.</span>
<span class="lnr"> 7906 </span>    <span class="Statement">if</span> ( traditional === <span class="Type">undefined</span> ) {
<span class="lnr"> 7907 </span>       traditional = jQuery.ajaxSettings &amp;&amp; jQuery.ajaxSettings.traditional;
<span class="lnr"> 7908 </span>    }
<span class="lnr"> 7909 </span>
<span class="lnr"> 7910 </span><span class="Comment">    // If an array was passed in, assume that it is an array of form elements.</span>
<span class="lnr"> 7911 </span>    <span class="Statement">if</span> ( jQuery.isArray( a ) || ( a.jquery &amp;&amp; !jQuery.isPlainObject( a ) ) ) {
<span class="lnr"> 7912 </span><span class="Comment">       // Serialize the form elements</span>
<span class="lnr"> 7913 </span>       jQuery.each( a, <span class="Identifier">function</span>() {
<span class="lnr"> 7914 </span>          add( <span class="Type">this</span>.name, <span class="Type">this</span>.value );
<span class="lnr"> 7915 </span>       });
<span class="lnr"> 7916 </span>
<span class="lnr"> 7917 </span>    } <span class="Statement">else</span> {
<span class="lnr"> 7918 </span><span class="Comment">       // If traditional, encode the &quot;old&quot; way (the way 1.3.2 or older</span>
<span class="lnr"> 7919 </span><span class="Comment">       // did it), otherwise encode params recursively.</span>
<span class="lnr"> 7920 </span>       <span class="Statement">for</span> ( prefix <span class="Statement">in</span> a ) {
<span class="lnr"> 7921 </span>          buildParams( prefix, a[ prefix ], traditional, add );
<span class="lnr"> 7922 </span>       }
<span class="lnr"> 7923 </span>    }
<span class="lnr"> 7924 </span>
<span class="lnr"> 7925 </span><span class="Comment">    // Return the resulting serialization</span>
<span class="lnr"> 7926 </span>    <span class="Statement">return</span> s.join( <span class="Constant">&quot;&amp;&quot;</span> ).replace( r20, <span class="Constant">&quot;+&quot;</span> );
<span class="lnr"> 7927 </span>};
<span class="lnr"> 7928 </span>
<span class="lnr"> 7929 </span><span class="Identifier">function</span> buildParams( prefix, obj, traditional, add ) {
<span class="lnr"> 7930 </span>    <span class="Type">var</span> name;
<span class="lnr"> 7931 </span>
<span class="lnr"> 7932 </span>    <span class="Statement">if</span> ( jQuery.isArray( obj ) ) {
<span class="lnr"> 7933 </span><span class="Comment">       // Serialize array item.</span>
<span class="lnr"> 7934 </span>       jQuery.each( obj, <span class="Identifier">function</span>( i, v ) {
<span class="lnr"> 7935 </span>          <span class="Statement">if</span> ( traditional || rbracket.test( prefix ) ) {
<span class="lnr"> 7936 </span><span class="Comment">             // Treat each array item as a scalar.</span>
<span class="lnr"> 7937 </span>             add( prefix, v );
<span class="lnr"> 7938 </span>
<span class="lnr"> 7939 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 7940 </span><span class="Comment">             // If array item is non-scalar (array or object), encode its</span>
<span class="lnr"> 7941 </span><span class="Comment">             // numeric index to resolve deserialization ambiguity issues.</span>
<span class="lnr"> 7942 </span><span class="Comment">             // Note that rack (as of 1.0.0) can't currently deserialize</span>
<span class="lnr"> 7943 </span><span class="Comment">             // nested arrays properly, and attempting to do so may cause</span>
<span class="lnr"> 7944 </span><span class="Comment">             // a server error. Possible fixes are to modify rack's</span>
<span class="lnr"> 7945 </span><span class="Comment">             // deserialization algorithm or to provide an option or flag</span>
<span class="lnr"> 7946 </span><span class="Comment">             // to force array serialization to be shallow.</span>
<span class="lnr"> 7947 </span>             buildParams( prefix + <span class="Constant">&quot;[&quot;</span> + ( <span class="Statement">typeof</span> v === <span class="Constant">&quot;object&quot;</span> ? i : <span class="Constant">&quot;&quot;</span> ) + <span class="Constant">&quot;]&quot;</span>, v, traditional, add );
<span class="lnr"> 7948 </span>          }
<span class="lnr"> 7949 </span>       });
<span class="lnr"> 7950 </span>
<span class="lnr"> 7951 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( !traditional &amp;&amp; jQuery.type( obj ) === <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 7952 </span><span class="Comment">       // Serialize object item.</span>
<span class="lnr"> 7953 </span>       <span class="Statement">for</span> ( name <span class="Statement">in</span> obj ) {
<span class="lnr"> 7954 </span>          buildParams( prefix + <span class="Constant">&quot;[&quot;</span> + name + <span class="Constant">&quot;]&quot;</span>, obj[ name ], traditional, add );
<span class="lnr"> 7955 </span>       }
<span class="lnr"> 7956 </span>
<span class="lnr"> 7957 </span>    } <span class="Statement">else</span> {
<span class="lnr"> 7958 </span><span class="Comment">       // Serialize scalar item.</span>
<span class="lnr"> 7959 </span>       add( prefix, obj );
<span class="lnr"> 7960 </span>    }
<span class="lnr"> 7961 </span>}
<span class="lnr"> 7962 </span><span class="Type">var</span> <span class="Comment">// Document location</span>
<span class="lnr"> 7963 </span>    ajaxLocation,
<span class="lnr"> 7964 </span><span class="Comment">    // Document location segments</span>
<span class="lnr"> 7965 </span>    ajaxLocParts,
<span class="lnr"> 7966 </span>
<span class="lnr"> 7967 </span>    rhash = <span class="Constant">/#.*$/</span>,
<span class="lnr"> 7968 </span>    rheaders = <span class="Constant">/^(.*?):[ </span><span class="Special">\t</span><span class="Constant">]*([^</span><span class="Special">\r\n</span><span class="Constant">]*)</span><span class="Special">\r</span><span class="Constant">?$/mg</span>, <span class="Comment">// IE leaves an \r character at EOL</span>
<span class="lnr"> 7969 </span><span class="Comment">    // #7653, #8125, #8152: local protocol detection</span>
<span class="lnr"> 7970 </span>    rlocalProtocol = <span class="Constant">/^(?:about|app|app</span><span class="Special">\-</span><span class="Constant">storage|.+</span><span class="Special">\-</span><span class="Constant">extension|file|res|widget):$/</span>,
<span class="lnr"> 7971 </span>    rnoContent = <span class="Constant">/^(?:GET|HEAD)$/</span>,
<span class="lnr"> 7972 </span>    rprotocol = <span class="Constant">/^</span><span class="Special">\/\/</span><span class="Constant">/</span>,
<span class="lnr"> 7973 </span>    rquery = <span class="Constant">/</span><span class="Special">\?</span><span class="Constant">/</span>,
<span class="lnr"> 7974 </span>    rscript = <span class="Constant">/&lt;script</span><span class="Special">\b</span><span class="Constant">[^&lt;]*(?:(?!&lt;</span><span class="Special">\/</span><span class="Constant">script&gt;)&lt;[^&lt;]*)*&lt;</span><span class="Special">\/</span><span class="Constant">script&gt;/gi</span>,
<span class="lnr"> 7975 </span>    rts = <span class="Constant">/([?&amp;])_=[^&amp;]*/</span>,
<span class="lnr"> 7976 </span>    rurl = <span class="Constant">/^([</span><span class="Special">\w\+\.\-</span><span class="Constant">]+:)(?:</span><span class="Special">\/\/</span><span class="Constant">([^</span><span class="Special">\/</span><span class="Constant">?#:]*)(?::(</span><span class="Special">\d</span><span class="Constant">+)|)|)/</span>,
<span class="lnr"> 7977 </span>
<span class="lnr"> 7978 </span><span class="Comment">    // Keep a copy of the old load method</span>
<span class="lnr"> 7979 </span>    _load = jQuery.fn.load,
<span class="lnr"> 7980 </span>
<span class="lnr"> 7981 </span>    <span class="Comment">/* Prefilters</span>
<span class="lnr"> 7982 </span><span class="Comment">     * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)</span>
<span class="lnr"> 7983 </span><span class="Comment">     * 2) These are called:</span>
<span class="lnr"> 7984 </span><span class="Comment">     *    - BEFORE asking for a transport</span>
<span class="lnr"> 7985 </span><span class="Comment">     *    - AFTER param serialization (s.data is a string if s.processData is true)</span>
<span class="lnr"> 7986 </span><span class="Comment">     * 3) key is the dataType</span>
<span class="lnr"> 7987 </span><span class="Comment">     * 4) the catchall symbol &quot;*&quot; can be used</span>
<span class="lnr"> 7988 </span><span class="Comment">     * 5) execution will start with transport dataType and THEN continue down to &quot;*&quot; if needed</span>
<span class="lnr"> 7989 </span><span class="Comment">     */</span>
<span class="lnr"> 7990 </span>    prefilters = {},
<span class="lnr"> 7991 </span>
<span class="lnr"> 7992 </span>    <span class="Comment">/* Transports bindings</span>
<span class="lnr"> 7993 </span><span class="Comment">     * 1) key is the dataType</span>
<span class="lnr"> 7994 </span><span class="Comment">     * 2) the catchall symbol &quot;*&quot; can be used</span>
<span class="lnr"> 7995 </span><span class="Comment">     * 3) selection will start with transport dataType and THEN go to &quot;*&quot; if needed</span>
<span class="lnr"> 7996 </span><span class="Comment">     */</span>
<span class="lnr"> 7997 </span>    transports = {},
<span class="lnr"> 7998 </span>
<span class="lnr"> 7999 </span><span class="Comment">    // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression</span>
<span class="lnr"> 8000 </span>    allTypes = [<span class="Constant">&quot;*/&quot;</span>] + [<span class="Constant">&quot;*&quot;</span>];
<span class="lnr"> 8001 </span>
<span class="lnr"> 8002 </span><span class="Comment">// #8138, IE may throw an exception when accessing</span>
<span class="lnr"> 8003 </span><span class="Comment">// a field from window.location if document.domain has been set</span>
<span class="lnr"> 8004 </span><span class="Statement">try</span> {
<span class="lnr"> 8005 </span>    ajaxLocation = location.href;
<span class="lnr"> 8006 </span>} <span class="Statement">catch</span>( e ) {
<span class="lnr"> 8007 </span><span class="Comment">    // Use the href attribute of an A element</span>
<span class="lnr"> 8008 </span><span class="Comment">    // since IE will modify it given document.location</span>
<span class="lnr"> 8009 </span>    ajaxLocation = document.createElement( <span class="Constant">&quot;a&quot;</span> );
<span class="lnr"> 8010 </span>    ajaxLocation.href = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 8011 </span>    ajaxLocation = ajaxLocation.href;
<span class="lnr"> 8012 </span>}
<span class="lnr"> 8013 </span>
<span class="lnr"> 8014 </span><span class="Comment">// Segment location into parts</span>
<span class="lnr"> 8015 </span>ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
<span class="lnr"> 8016 </span>
<span class="lnr"> 8017 </span><span class="Comment">// Base &quot;constructor&quot; for jQuery.ajaxPrefilter and jQuery.ajaxTransport</span>
<span class="lnr"> 8018 </span><span class="Identifier">function</span> addToPrefiltersOrTransports( structure ) {
<span class="lnr"> 8019 </span>
<span class="lnr"> 8020 </span><span class="Comment">    // dataTypeExpression is optional and defaults to &quot;*&quot;</span>
<span class="lnr"> 8021 </span>    <span class="Statement">return</span> <span class="Identifier">function</span>( dataTypeExpression, func ) {
<span class="lnr"> 8022 </span>
<span class="lnr"> 8023 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> dataTypeExpression !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 8024 </span>          func = dataTypeExpression;
<span class="lnr"> 8025 </span>          dataTypeExpression = <span class="Constant">&quot;*&quot;</span>;
<span class="lnr"> 8026 </span>       }
<span class="lnr"> 8027 </span>
<span class="lnr"> 8028 </span>       <span class="Type">var</span> dataType, list, placeBefore,
<span class="lnr"> 8029 </span>          dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ),
<span class="lnr"> 8030 </span>          i = <span class="Constant">0</span>,
<span class="lnr"> 8031 </span>          length = dataTypes.length;
<span class="lnr"> 8032 </span>
<span class="lnr"> 8033 </span>       <span class="Statement">if</span> ( jQuery.isFunction( func ) ) {
<span class="lnr"> 8034 </span><span class="Comment">          // For each dataType in the dataTypeExpression</span>
<span class="lnr"> 8035 </span>          <span class="Statement">for</span> ( ; i &lt; length; i++ ) {
<span class="lnr"> 8036 </span>             dataType = dataTypes[ i ];
<span class="lnr"> 8037 </span><span class="Comment">             // We control if we're asked to add before</span>
<span class="lnr"> 8038 </span><span class="Comment">             // any existing element</span>
<span class="lnr"> 8039 </span>             placeBefore = <span class="Constant">/^</span><span class="Special">\+</span><span class="Constant">/</span>.test( dataType );
<span class="lnr"> 8040 </span>             <span class="Statement">if</span> ( placeBefore ) {
<span class="lnr"> 8041 </span>                dataType = dataType.substr( <span class="Constant">1</span> ) || <span class="Constant">&quot;*&quot;</span>;
<span class="lnr"> 8042 </span>             }
<span class="lnr"> 8043 </span>             list = structure[ dataType ] = structure[ dataType ] || [];
<span class="lnr"> 8044 </span><span class="Comment">             // then we add to the structure accordingly</span>
<span class="lnr"> 8045 </span>             list[ placeBefore ? <span class="Constant">&quot;unshift&quot;</span> : <span class="Constant">&quot;push&quot;</span> ]( func );
<span class="lnr"> 8046 </span>          }
<span class="lnr"> 8047 </span>       }
<span class="lnr"> 8048 </span>    };
<span class="lnr"> 8049 </span>}
<span class="lnr"> 8050 </span>
<span class="lnr"> 8051 </span><span class="Comment">// Base inspection function for prefilters and transports</span>
<span class="lnr"> 8052 </span><span class="Identifier">function</span> inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
<span class="lnr"> 8053 </span>       dataType <span class="Comment">/* internal */</span>, inspected <span class="Comment">/* internal */</span> ) {
<span class="lnr"> 8054 </span>
<span class="lnr"> 8055 </span>    dataType = dataType || options.dataTypes[ <span class="Constant">0</span> ];
<span class="lnr"> 8056 </span>    inspected = inspected || {};
<span class="lnr"> 8057 </span>
<span class="lnr"> 8058 </span>    inspected[ dataType ] = <span class="Constant">true</span>;
<span class="lnr"> 8059 </span>
<span class="lnr"> 8060 </span>    <span class="Type">var</span> selection,
<span class="lnr"> 8061 </span>       list = structure[ dataType ],
<span class="lnr"> 8062 </span>       i = <span class="Constant">0</span>,
<span class="lnr"> 8063 </span>       length = list ? list.<span class="Statement">length</span> : <span class="Constant">0</span>,
<span class="lnr"> 8064 </span>       executeOnly = ( structure === prefilters );
<span class="lnr"> 8065 </span>
<span class="lnr"> 8066 </span>    <span class="Statement">for</span> ( ; i &lt; length &amp;&amp; ( executeOnly || !selection ); i++ ) {
<span class="lnr"> 8067 </span>       selection = list[ i ]( options, originalOptions, jqXHR );
<span class="lnr"> 8068 </span><span class="Comment">       // If we got redirected to another dataType</span>
<span class="lnr"> 8069 </span><span class="Comment">       // we try there if executing only and not done already</span>
<span class="lnr"> 8070 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> selection === <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 8071 </span>          <span class="Statement">if</span> ( !executeOnly || inspected[ selection ] ) {
<span class="lnr"> 8072 </span>             selection = <span class="Type">undefined</span>;
<span class="lnr"> 8073 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 8074 </span>             options.dataTypes.unshift( selection );
<span class="lnr"> 8075 </span>             selection = inspectPrefiltersOrTransports(
<span class="lnr"> 8076 </span>                   structure, options, originalOptions, jqXHR, selection, inspected );
<span class="lnr"> 8077 </span>          }
<span class="lnr"> 8078 </span>       }
<span class="lnr"> 8079 </span>    }
<span class="lnr"> 8080 </span><span class="Comment">    // If we're only executing or nothing was selected</span>
<span class="lnr"> 8081 </span><span class="Comment">    // we try the catchall dataType if not done already</span>
<span class="lnr"> 8082 </span>    <span class="Statement">if</span> ( ( executeOnly || !selection ) &amp;&amp; !inspected[ <span class="Constant">&quot;*&quot;</span> ] ) {
<span class="lnr"> 8083 </span>       selection = inspectPrefiltersOrTransports(
<span class="lnr"> 8084 </span>             structure, options, originalOptions, jqXHR, <span class="Constant">&quot;*&quot;</span>, inspected );
<span class="lnr"> 8085 </span>    }
<span class="lnr"> 8086 </span><span class="Comment">    // unnecessary when only executing (prefilters)</span>
<span class="lnr"> 8087 </span><span class="Comment">    // but it'll be ignored by the caller in that case</span>
<span class="lnr"> 8088 </span>    <span class="Statement">return</span> selection;
<span class="lnr"> 8089 </span>}
<span class="lnr"> 8090 </span>
<span class="lnr"> 8091 </span><span class="Comment">// A special extend for ajax options</span>
<span class="lnr"> 8092 </span><span class="Comment">// that takes &quot;flat&quot; options (not to be deep extended)</span>
<span class="lnr"> 8093 </span><span class="Comment">// Fixes #9887</span>
<span class="lnr"> 8094 </span><span class="Identifier">function</span> ajaxExtend( target, src ) {
<span class="lnr"> 8095 </span>    <span class="Type">var</span> key, deep,
<span class="lnr"> 8096 </span>       flatOptions = jQuery.ajaxSettings.flatOptions || {};
<span class="lnr"> 8097 </span>    <span class="Statement">for</span> ( key <span class="Statement">in</span> src ) {
<span class="lnr"> 8098 </span>       <span class="Statement">if</span> ( src[ key ] !== <span class="Type">undefined</span> ) {
<span class="lnr"> 8099 </span>          ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
<span class="lnr"> 8100 </span>       }
<span class="lnr"> 8101 </span>    }
<span class="lnr"> 8102 </span>    <span class="Statement">if</span> ( deep ) {
<span class="lnr"> 8103 </span>       jQuery.extend( <span class="Constant">true</span>, target, deep );
<span class="lnr"> 8104 </span>    }
<span class="lnr"> 8105 </span>}
<span class="lnr"> 8106 </span>
<span class="lnr"> 8107 </span>jQuery.fn.load = <span class="Identifier">function</span>( url, params, callback ) {
<span class="lnr"> 8108 </span>    <span class="Statement">if</span> ( <span class="Statement">typeof</span> url !== <span class="Constant">&quot;string&quot;</span> &amp;&amp; _load ) {
<span class="lnr"> 8109 </span>       <span class="Statement">return</span> _load.apply( <span class="Type">this</span>, arguments );
<span class="lnr"> 8110 </span>    }
<span class="lnr"> 8111 </span>
<span class="lnr"> 8112 </span><span class="Comment">    // Don't do a request if no elements are being requested</span>
<span class="lnr"> 8113 </span>    <span class="Statement">if</span> ( !<span class="Type">this</span>.length ) {
<span class="lnr"> 8114 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 8115 </span>    }
<span class="lnr"> 8116 </span>
<span class="lnr"> 8117 </span>    <span class="Type">var</span> selector, type, response,
<span class="lnr"> 8118 </span>       self = <span class="Type">this</span>,
<span class="lnr"> 8119 </span>       off = url.indexOf(<span class="Constant">&quot; &quot;</span>);
<span class="lnr"> 8120 </span>
<span class="lnr"> 8121 </span>    <span class="Statement">if</span> ( off &gt;= <span class="Constant">0</span> ) {
<span class="lnr"> 8122 </span>       selector = url.slice( off, url.length );
<span class="lnr"> 8123 </span>       url = url.slice( <span class="Constant">0</span>, off );
<span class="lnr"> 8124 </span>    }
<span class="lnr"> 8125 </span>
<span class="lnr"> 8126 </span><span class="Comment">    // If it's a function</span>
<span class="lnr"> 8127 </span>    <span class="Statement">if</span> ( jQuery.isFunction( params ) ) {
<span class="lnr"> 8128 </span>
<span class="lnr"> 8129 </span><span class="Comment">       // We assume that it's the callback</span>
<span class="lnr"> 8130 </span>       callback = params;
<span class="lnr"> 8131 </span>       params = <span class="Type">undefined</span>;
<span class="lnr"> 8132 </span>
<span class="lnr"> 8133 </span><span class="Comment">    // Otherwise, build a param string</span>
<span class="lnr"> 8134 </span>    } <span class="Statement">else</span> <span class="Statement">if</span> ( params &amp;&amp; <span class="Statement">typeof</span> params === <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 8135 </span>       type = <span class="Constant">&quot;POST&quot;</span>;
<span class="lnr"> 8136 </span>    }
<span class="lnr"> 8137 </span>
<span class="lnr"> 8138 </span><span class="Comment">    // Request the remote document</span>
<span class="lnr"> 8139 </span>    jQuery.ajax({
<span class="lnr"> 8140 </span>       <span class="Statement">url</span>: url,
<span class="lnr"> 8141 </span>
<span class="lnr"> 8142 </span><span class="Comment">       // if &quot;type&quot; variable is undefined, then &quot;GET&quot; method will be used</span>
<span class="lnr"> 8143 </span>       <span class="Statement">type</span>: type,
<span class="lnr"> 8144 </span>       <span class="Statement">dataType</span>: <span class="Constant">&quot;html&quot;</span>,
<span class="lnr"> 8145 </span>       <span class="Statement">data</span>: params,
<span class="lnr"> 8146 </span>       <span class="Statement">complete</span>: <span class="Identifier">function</span>( jqXHR, status ) {
<span class="lnr"> 8147 </span>          <span class="Statement">if</span> ( callback ) {
<span class="lnr"> 8148 </span>             self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
<span class="lnr"> 8149 </span>          }
<span class="lnr"> 8150 </span>       }
<span class="lnr"> 8151 </span>    }).done(<span class="Identifier">function</span>( responseText ) {
<span class="lnr"> 8152 </span>
<span class="lnr"> 8153 </span><span class="Comment">       // Save response for use in complete callback</span>
<span class="lnr"> 8154 </span>       response = arguments;
<span class="lnr"> 8155 </span>
<span class="lnr"> 8156 </span><span class="Comment">       // See if a selector was specified</span>
<span class="lnr"> 8157 </span>       self.html( selector ?
<span class="lnr"> 8158 </span>
<span class="lnr"> 8159 </span><span class="Comment">          // Create a dummy div to hold the results</span>
<span class="lnr"> 8160 </span>          jQuery(<span class="Constant">&quot;&lt;div&gt;&quot;</span>)
<span class="lnr"> 8161 </span>
<span class="lnr"> 8162 </span><span class="Comment">             // inject the contents of the document in, removing the scripts</span>
<span class="lnr"> 8163 </span><span class="Comment">             // to avoid any 'Permission Denied' errors in IE</span>
<span class="lnr"> 8164 </span>             .append( responseText.replace( rscript, <span class="Constant">&quot;&quot;</span> ) )
<span class="lnr"> 8165 </span>
<span class="lnr"> 8166 </span><span class="Comment">             // Locate the specified elements</span>
<span class="lnr"> 8167 </span>             .find( selector ) :
<span class="lnr"> 8168 </span>
<span class="lnr"> 8169 </span><span class="Comment">          // If not, just inject the full result</span>
<span class="lnr"> 8170 </span>          responseText );
<span class="lnr"> 8171 </span>
<span class="lnr"> 8172 </span>    });
<span class="lnr"> 8173 </span>
<span class="lnr"> 8174 </span>    <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 8175 </span>};
<span class="lnr"> 8176 </span>
<span class="lnr"> 8177 </span><span class="Comment">// Attach a bunch of functions for handling common AJAX events</span>
<span class="lnr"> 8178 </span>jQuery.each( <span class="Constant">&quot;ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend&quot;</span>.split( <span class="Constant">&quot; &quot;</span> ), <span class="Identifier">function</span>( i, o ){
<span class="lnr"> 8179 </span>    jQuery.fn[ o ] = <span class="Identifier">function</span>( f ){
<span class="lnr"> 8180 </span>       <span class="Statement">return</span> <span class="Type">this</span>.on( o, f );
<span class="lnr"> 8181 </span>    };
<span class="lnr"> 8182 </span>});
<span class="lnr"> 8183 </span>
<span class="lnr"> 8184 </span>jQuery.each( [ <span class="Constant">&quot;get&quot;</span>, <span class="Constant">&quot;post&quot;</span> ], <span class="Identifier">function</span>( i, method ) {
<span class="lnr"> 8185 </span>    jQuery[ method ] = <span class="Identifier">function</span>( url, data, callback, type ) {
<span class="lnr"> 8186 </span><span class="Comment">       // shift arguments if data argument was omitted</span>
<span class="lnr"> 8187 </span>       <span class="Statement">if</span> ( jQuery.isFunction( data ) ) {
<span class="lnr"> 8188 </span>          type = type || callback;
<span class="lnr"> 8189 </span>          callback = data;
<span class="lnr"> 8190 </span>          data = <span class="Type">undefined</span>;
<span class="lnr"> 8191 </span>       }
<span class="lnr"> 8192 </span>
<span class="lnr"> 8193 </span>       <span class="Statement">return</span> jQuery.ajax({
<span class="lnr"> 8194 </span>          <span class="Statement">type</span>: method,
<span class="lnr"> 8195 </span>          <span class="Statement">url</span>: url,
<span class="lnr"> 8196 </span>          <span class="Statement">data</span>: data,
<span class="lnr"> 8197 </span>          <span class="Statement">success</span>: callback,
<span class="lnr"> 8198 </span>          <span class="Statement">dataType</span>: type
<span class="lnr"> 8199 </span>       });
<span class="lnr"> 8200 </span>    };
<span class="lnr"> 8201 </span>});
<span class="lnr"> 8202 </span>
<span class="lnr"> 8203 </span>jQuery.extend({
<span class="lnr"> 8204 </span>
<span class="lnr"> 8205 </span>    <span class="Statement">getScript</span>: <span class="Identifier">function</span>( url, callback ) {
<span class="lnr"> 8206 </span>       <span class="Statement">return</span> jQuery.get( url, <span class="Type">undefined</span>, callback, <span class="Constant">&quot;script&quot;</span> );
<span class="lnr"> 8207 </span>    },
<span class="lnr"> 8208 </span>
<span class="lnr"> 8209 </span>    <span class="Statement">getJSON</span>: <span class="Identifier">function</span>( url, data, callback ) {
<span class="lnr"> 8210 </span>       <span class="Statement">return</span> jQuery.get( url, data, callback, <span class="Constant">&quot;json&quot;</span> );
<span class="lnr"> 8211 </span>    },
<span class="lnr"> 8212 </span>
<span class="lnr"> 8213 </span><span class="Comment">    // Creates a full fledged settings object into target</span>
<span class="lnr"> 8214 </span><span class="Comment">    // with both ajaxSettings and settings fields.</span>
<span class="lnr"> 8215 </span><span class="Comment">    // If target is omitted, writes into ajaxSettings.</span>
<span class="lnr"> 8216 </span>    <span class="Statement">ajaxSetup</span>: <span class="Identifier">function</span>( target, settings ) {
<span class="lnr"> 8217 </span>       <span class="Statement">if</span> ( settings ) {
<span class="lnr"> 8218 </span><span class="Comment">          // Building a settings object</span>
<span class="lnr"> 8219 </span>          ajaxExtend( target, jQuery.ajaxSettings );
<span class="lnr"> 8220 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 8221 </span><span class="Comment">          // Extending ajaxSettings</span>
<span class="lnr"> 8222 </span>          settings = target;
<span class="lnr"> 8223 </span>          target = jQuery.ajaxSettings;
<span class="lnr"> 8224 </span>       }
<span class="lnr"> 8225 </span>       ajaxExtend( target, settings );
<span class="lnr"> 8226 </span>       <span class="Statement">return</span> target;
<span class="lnr"> 8227 </span>    },
<span class="lnr"> 8228 </span>
<span class="lnr"> 8229 </span>    <span class="Statement">ajaxSettings</span>: {
<span class="lnr"> 8230 </span>       <span class="Statement">url</span>: ajaxLocation,
<span class="lnr"> 8231 </span>       <span class="Statement">isLocal</span>: rlocalProtocol.test( ajaxLocParts[ <span class="Constant">1</span> ] ),
<span class="lnr"> 8232 </span>       <span class="Statement">global</span>: <span class="Constant">true</span>,
<span class="lnr"> 8233 </span>       <span class="Statement">type</span>: <span class="Constant">&quot;GET&quot;</span>,
<span class="lnr"> 8234 </span>       <span class="Statement">contentType</span>: <span class="Constant">&quot;application/x-www-form-urlencoded; charset=UTF-8&quot;</span>,
<span class="lnr"> 8235 </span>       <span class="Statement">processData</span>: <span class="Constant">true</span>,
<span class="lnr"> 8236 </span>       <span class="Statement">async</span>: <span class="Constant">true</span>,
<span class="lnr"> 8237 </span>       <span class="Comment">/*</span>
<span class="lnr"> 8238 </span><span class="Comment">       timeout: 0,</span>
<span class="lnr"> 8239 </span><span class="Comment">       data: null,</span>
<span class="lnr"> 8240 </span><span class="Comment">       dataType: null,</span>
<span class="lnr"> 8241 </span><span class="Comment">       username: null,</span>
<span class="lnr"> 8242 </span><span class="Comment">       password: null,</span>
<span class="lnr"> 8243 </span><span class="Comment">       cache: null,</span>
<span class="lnr"> 8244 </span><span class="Comment">       throws: false,</span>
<span class="lnr"> 8245 </span><span class="Comment">       traditional: false,</span>
<span class="lnr"> 8246 </span><span class="Comment">       headers: {},</span>
<span class="lnr"> 8247 </span><span class="Comment">       */</span>
<span class="lnr"> 8248 </span>
<span class="lnr"> 8249 </span>       <span class="Statement">accepts</span>: {
<span class="lnr"> 8250 </span>          <span class="Statement">xml</span>: <span class="Constant">&quot;application/xml, text/xml&quot;</span>,
<span class="lnr"> 8251 </span>          <span class="Statement">html</span>: <span class="Constant">&quot;text/html&quot;</span>,
<span class="lnr"> 8252 </span>          <span class="Statement">text</span>: <span class="Constant">&quot;text/plain&quot;</span>,
<span class="lnr"> 8253 </span>          <span class="Statement">json</span>: <span class="Constant">&quot;application/json, text/javascript&quot;</span>,
<span class="lnr"> 8254 </span>          <span class="Constant">&quot;*&quot;</span>: allTypes
<span class="lnr"> 8255 </span>       },
<span class="lnr"> 8256 </span>
<span class="lnr"> 8257 </span>       <span class="Statement">contents</span>: {
<span class="lnr"> 8258 </span>          <span class="Statement">xml</span>: <span class="Constant">/xml/</span>,
<span class="lnr"> 8259 </span>          <span class="Statement">html</span>: <span class="Constant">/html/</span>,
<span class="lnr"> 8260 </span>          <span class="Statement">json</span>: <span class="Constant">/json/</span>
<span class="lnr"> 8261 </span>       },
<span class="lnr"> 8262 </span>
<span class="lnr"> 8263 </span>       <span class="Statement">responseFields</span>: {
<span class="lnr"> 8264 </span>          <span class="Statement">xml</span>: <span class="Constant">&quot;responseXML&quot;</span>,
<span class="lnr"> 8265 </span>          <span class="Statement">text</span>: <span class="Constant">&quot;responseText&quot;</span>
<span class="lnr"> 8266 </span>       },
<span class="lnr"> 8267 </span>
<span class="lnr"> 8268 </span><span class="Comment">       // List of data converters</span>
<span class="lnr"> 8269 </span><span class="Comment">       // 1) key format is &quot;source_type destination_type&quot; (a single space in-between)</span>
<span class="lnr"> 8270 </span><span class="Comment">       // 2) the catchall symbol &quot;*&quot; can be used for source_type</span>
<span class="lnr"> 8271 </span>       <span class="Statement">converters</span>: {
<span class="lnr"> 8272 </span>
<span class="lnr"> 8273 </span><span class="Comment">          // Convert anything to text</span>
<span class="lnr"> 8274 </span>          <span class="Constant">&quot;* text&quot;</span>: window.<span class="Special">String</span>,
<span class="lnr"> 8275 </span>
<span class="lnr"> 8276 </span><span class="Comment">          // Text to html (true = no transformation)</span>
<span class="lnr"> 8277 </span>          <span class="Constant">&quot;text html&quot;</span>: <span class="Constant">true</span>,
<span class="lnr"> 8278 </span>
<span class="lnr"> 8279 </span><span class="Comment">          // Evaluate text as a json expression</span>
<span class="lnr"> 8280 </span>          <span class="Constant">&quot;text json&quot;</span>: jQuery.parseJSON,
<span class="lnr"> 8281 </span>
<span class="lnr"> 8282 </span><span class="Comment">          // Parse text as xml</span>
<span class="lnr"> 8283 </span>          <span class="Constant">&quot;text xml&quot;</span>: jQuery.parseXML
<span class="lnr"> 8284 </span>       },
<span class="lnr"> 8285 </span>
<span class="lnr"> 8286 </span><span class="Comment">       // For options that shouldn't be deep extended:</span>
<span class="lnr"> 8287 </span><span class="Comment">       // you can add your own custom options here if</span>
<span class="lnr"> 8288 </span><span class="Comment">       // and when you create one that shouldn't be</span>
<span class="lnr"> 8289 </span><span class="Comment">       // deep extended (see ajaxExtend)</span>
<span class="lnr"> 8290 </span>       <span class="Statement">flatOptions</span>: {
<span class="lnr"> 8291 </span>          <span class="Statement">context</span>: <span class="Constant">true</span>,
<span class="lnr"> 8292 </span>          <span class="Statement">url</span>: <span class="Constant">true</span>
<span class="lnr"> 8293 </span>       }
<span class="lnr"> 8294 </span>    },
<span class="lnr"> 8295 </span>
<span class="lnr"> 8296 </span>    <span class="Statement">ajaxPrefilter</span>: addToPrefiltersOrTransports( prefilters ),
<span class="lnr"> 8297 </span>    <span class="Statement">ajaxTransport</span>: addToPrefiltersOrTransports( transports ),
<span class="lnr"> 8298 </span>
<span class="lnr"> 8299 </span><span class="Comment">    // Main method</span>
<span class="lnr"> 8300 </span>    <span class="Statement">ajax</span>: <span class="Identifier">function</span>( url, options ) {
<span class="lnr"> 8301 </span>
<span class="lnr"> 8302 </span><span class="Comment">       // If url is an object, simulate pre-1.5 signature</span>
<span class="lnr"> 8303 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> url === <span class="Constant">&quot;object&quot;</span> ) {
<span class="lnr"> 8304 </span>          options = url;
<span class="lnr"> 8305 </span>          url = <span class="Type">undefined</span>;
<span class="lnr"> 8306 </span>       }
<span class="lnr"> 8307 </span>
<span class="lnr"> 8308 </span><span class="Comment">       // Force options to be an object</span>
<span class="lnr"> 8309 </span>       options = options || {};
<span class="lnr"> 8310 </span>
<span class="lnr"> 8311 </span>       <span class="Type">var</span> <span class="Comment">// ifModified key</span>
<span class="lnr"> 8312 </span>          ifModifiedKey,
<span class="lnr"> 8313 </span><span class="Comment">          // Response headers</span>
<span class="lnr"> 8314 </span>          responseHeadersString,
<span class="lnr"> 8315 </span>          responseHeaders,
<span class="lnr"> 8316 </span><span class="Comment">          // transport</span>
<span class="lnr"> 8317 </span>          transport,
<span class="lnr"> 8318 </span><span class="Comment">          // timeout handle</span>
<span class="lnr"> 8319 </span>          timeoutTimer,
<span class="lnr"> 8320 </span><span class="Comment">          // Cross-domain detection vars</span>
<span class="lnr"> 8321 </span>          parts,
<span class="lnr"> 8322 </span><span class="Comment">          // To know if global events are to be dispatched</span>
<span class="lnr"> 8323 </span>          fireGlobals,
<span class="lnr"> 8324 </span><span class="Comment">          // Loop variable</span>
<span class="lnr"> 8325 </span>          i,
<span class="lnr"> 8326 </span><span class="Comment">          // Create the final options object</span>
<span class="lnr"> 8327 </span>          s = jQuery.ajaxSetup( {}, options ),
<span class="lnr"> 8328 </span><span class="Comment">          // Callbacks context</span>
<span class="lnr"> 8329 </span>          callbackContext = s.context || s,
<span class="lnr"> 8330 </span><span class="Comment">          // Context for global events</span>
<span class="lnr"> 8331 </span><span class="Comment">          // It's the callbackContext if one was provided in the options</span>
<span class="lnr"> 8332 </span><span class="Comment">          // and if it's a DOM node or a jQuery collection</span>
<span class="lnr"> 8333 </span>          globalEventContext = callbackContext !== s &amp;&amp;
<span class="lnr"> 8334 </span>             ( callbackContext.nodeType || callbackContext <span class="Statement">instanceof</span> jQuery ) ?
<span class="lnr"> 8335 </span>                   jQuery( callbackContext ) : jQuery.event,
<span class="lnr"> 8336 </span><span class="Comment">          // Deferreds</span>
<span class="lnr"> 8337 </span>          deferred = jQuery.Deferred(),
<span class="lnr"> 8338 </span>          completeDeferred = jQuery.Callbacks( <span class="Constant">&quot;once memory&quot;</span> ),
<span class="lnr"> 8339 </span><span class="Comment">          // Status-dependent callbacks</span>
<span class="lnr"> 8340 </span>          statusCode = s.statusCode || {},
<span class="lnr"> 8341 </span><span class="Comment">          // Headers (they are sent all at once)</span>
<span class="lnr"> 8342 </span>          requestHeaders = {},
<span class="lnr"> 8343 </span>          requestHeadersNames = {},
<span class="lnr"> 8344 </span><span class="Comment">          // The jqXHR state</span>
<span class="lnr"> 8345 </span>          state = <span class="Constant">0</span>,
<span class="lnr"> 8346 </span><span class="Comment">          // Default abort message</span>
<span class="lnr"> 8347 </span>          strAbort = <span class="Constant">&quot;canceled&quot;</span>,
<span class="lnr"> 8348 </span><span class="Comment">          // Fake xhr</span>
<span class="lnr"> 8349 </span>          jqXHR = {
<span class="lnr"> 8350 </span>
<span class="lnr"> 8351 </span>             <span class="Statement">readyState</span>: <span class="Constant">0</span>,
<span class="lnr"> 8352 </span>
<span class="lnr"> 8353 </span><span class="Comment">             // Caches the header</span>
<span class="lnr"> 8354 </span>             <span class="Statement">setRequestHeader</span>: <span class="Identifier">function</span>( name, value ) {
<span class="lnr"> 8355 </span>                <span class="Statement">if</span> ( !state ) {
<span class="lnr"> 8356 </span>                   <span class="Type">var</span> lname = name.toLowerCase();
<span class="lnr"> 8357 </span>                   name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
<span class="lnr"> 8358 </span>                   requestHeaders[ name ] = value;
<span class="lnr"> 8359 </span>                }
<span class="lnr"> 8360 </span>                <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 8361 </span>             },
<span class="lnr"> 8362 </span>
<span class="lnr"> 8363 </span><span class="Comment">             // Raw string</span>
<span class="lnr"> 8364 </span>             <span class="Statement">getAllResponseHeaders</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 8365 </span>                <span class="Statement">return</span> state === <span class="Constant">2</span> ? responseHeadersString : <span class="Type">null</span>;
<span class="lnr"> 8366 </span>             },
<span class="lnr"> 8367 </span>
<span class="lnr"> 8368 </span><span class="Comment">             // Builds headers hashtable if needed</span>
<span class="lnr"> 8369 </span>             <span class="Statement">getResponseHeader</span>: <span class="Identifier">function</span>( key ) {
<span class="lnr"> 8370 </span>                <span class="Type">var</span> match;
<span class="lnr"> 8371 </span>                <span class="Statement">if</span> ( state === <span class="Constant">2</span> ) {
<span class="lnr"> 8372 </span>                   <span class="Statement">if</span> ( !responseHeaders ) {
<span class="lnr"> 8373 </span>                      responseHeaders = {};
<span class="lnr"> 8374 </span>                      <span class="Statement">while</span>( ( match = rheaders.exec( responseHeadersString ) ) ) {
<span class="lnr"> 8375 </span>                         responseHeaders[ match[<span class="Constant">1</span>].toLowerCase() ] = match[ <span class="Constant">2</span> ];
<span class="lnr"> 8376 </span>                      }
<span class="lnr"> 8377 </span>                   }
<span class="lnr"> 8378 </span>                   match = responseHeaders[ key.toLowerCase() ];
<span class="lnr"> 8379 </span>                }
<span class="lnr"> 8380 </span>                <span class="Statement">return</span> match === <span class="Type">undefined</span> ? <span class="Type">null</span> : match;
<span class="lnr"> 8381 </span>             },
<span class="lnr"> 8382 </span>
<span class="lnr"> 8383 </span><span class="Comment">             // Overrides response content-type header</span>
<span class="lnr"> 8384 </span>             <span class="Statement">overrideMimeType</span>: <span class="Identifier">function</span>( type ) {
<span class="lnr"> 8385 </span>                <span class="Statement">if</span> ( !state ) {
<span class="lnr"> 8386 </span>                   s.mimeType = type;
<span class="lnr"> 8387 </span>                }
<span class="lnr"> 8388 </span>                <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 8389 </span>             },
<span class="lnr"> 8390 </span>
<span class="lnr"> 8391 </span><span class="Comment">             // Cancel the request</span>
<span class="lnr"> 8392 </span>             <span class="Statement">abort</span>: <span class="Identifier">function</span>( statusText ) {
<span class="lnr"> 8393 </span>                statusText = statusText || strAbort;
<span class="lnr"> 8394 </span>                <span class="Statement">if</span> ( transport ) {
<span class="lnr"> 8395 </span>                   transport.abort( statusText );
<span class="lnr"> 8396 </span>                }
<span class="lnr"> 8397 </span>                done( <span class="Constant">0</span>, statusText );
<span class="lnr"> 8398 </span>                <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 8399 </span>             }
<span class="lnr"> 8400 </span>          };
<span class="lnr"> 8401 </span>
<span class="lnr"> 8402 </span><span class="Comment">       // Callback for when everything is done</span>
<span class="lnr"> 8403 </span><span class="Comment">       // It is defined here because jslint complains if it is declared</span>
<span class="lnr"> 8404 </span><span class="Comment">       // at the end of the function (which would be more logical and readable)</span>
<span class="lnr"> 8405 </span>       <span class="Identifier">function</span> done( status, nativeStatusText, responses, headers ) {
<span class="lnr"> 8406 </span>          <span class="Type">var</span> isSuccess, success, error, response, modified,
<span class="lnr"> 8407 </span>             statusText = nativeStatusText;
<span class="lnr"> 8408 </span>
<span class="lnr"> 8409 </span><span class="Comment">          // Called once</span>
<span class="lnr"> 8410 </span>          <span class="Statement">if</span> ( state === <span class="Constant">2</span> ) {
<span class="lnr"> 8411 </span>             <span class="Statement">return</span>;
<span class="lnr"> 8412 </span>          }
<span class="lnr"> 8413 </span>
<span class="lnr"> 8414 </span><span class="Comment">          // State is &quot;done&quot; now</span>
<span class="lnr"> 8415 </span>          state = <span class="Constant">2</span>;
<span class="lnr"> 8416 </span>
<span class="lnr"> 8417 </span><span class="Comment">          // Clear timeout if it exists</span>
<span class="lnr"> 8418 </span>          <span class="Statement">if</span> ( timeoutTimer ) {
<span class="lnr"> 8419 </span>             clearTimeout( timeoutTimer );
<span class="lnr"> 8420 </span>          }
<span class="lnr"> 8421 </span>
<span class="lnr"> 8422 </span><span class="Comment">          // Dereference transport for early garbage collection</span>
<span class="lnr"> 8423 </span><span class="Comment">          // (no matter how long the jqXHR object will be used)</span>
<span class="lnr"> 8424 </span>          transport = <span class="Type">undefined</span>;
<span class="lnr"> 8425 </span>
<span class="lnr"> 8426 </span><span class="Comment">          // Cache response headers</span>
<span class="lnr"> 8427 </span>          responseHeadersString = headers || <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 8428 </span>
<span class="lnr"> 8429 </span><span class="Comment">          // Set readyState</span>
<span class="lnr"> 8430 </span>          jqXHR.readyState = status &gt; <span class="Constant">0</span> ? <span class="Constant">4</span> : <span class="Constant">0</span>;
<span class="lnr"> 8431 </span>
<span class="lnr"> 8432 </span><span class="Comment">          // Get response data</span>
<span class="lnr"> 8433 </span>          <span class="Statement">if</span> ( responses ) {
<span class="lnr"> 8434 </span>             response = ajaxHandleResponses( s, jqXHR, responses );
<span class="lnr"> 8435 </span>          }
<span class="lnr"> 8436 </span>
<span class="lnr"> 8437 </span><span class="Comment">          // If successful, handle type chaining</span>
<span class="lnr"> 8438 </span>          <span class="Statement">if</span> ( status &gt;= <span class="Constant">200</span> &amp;&amp; status &lt; <span class="Constant">300</span> || status === <span class="Constant">304</span> ) {
<span class="lnr"> 8439 </span>
<span class="lnr"> 8440 </span><span class="Comment">             // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.</span>
<span class="lnr"> 8441 </span>             <span class="Statement">if</span> ( s.ifModified ) {
<span class="lnr"> 8442 </span>
<span class="lnr"> 8443 </span>                modified = jqXHR.getResponseHeader(<span class="Constant">&quot;Last-Modified&quot;</span>);
<span class="lnr"> 8444 </span>                <span class="Statement">if</span> ( modified ) {
<span class="lnr"> 8445 </span>                   jQuery.lastModified[ ifModifiedKey ] = modified;
<span class="lnr"> 8446 </span>                }
<span class="lnr"> 8447 </span>                modified = jqXHR.getResponseHeader(<span class="Constant">&quot;Etag&quot;</span>);
<span class="lnr"> 8448 </span>                <span class="Statement">if</span> ( modified ) {
<span class="lnr"> 8449 </span>                   jQuery.etag[ ifModifiedKey ] = modified;
<span class="lnr"> 8450 </span>                }
<span class="lnr"> 8451 </span>             }
<span class="lnr"> 8452 </span>
<span class="lnr"> 8453 </span><span class="Comment">             // If not modified</span>
<span class="lnr"> 8454 </span>             <span class="Statement">if</span> ( status === <span class="Constant">304</span> ) {
<span class="lnr"> 8455 </span>
<span class="lnr"> 8456 </span>                statusText = <span class="Constant">&quot;notmodified&quot;</span>;
<span class="lnr"> 8457 </span>                isSuccess = <span class="Constant">true</span>;
<span class="lnr"> 8458 </span>
<span class="lnr"> 8459 </span><span class="Comment">             // If we have data</span>
<span class="lnr"> 8460 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 8461 </span>
<span class="lnr"> 8462 </span>                isSuccess = ajaxConvert( s, response );
<span class="lnr"> 8463 </span>                statusText = isSuccess.state;
<span class="lnr"> 8464 </span>                success = isSuccess.data;
<span class="lnr"> 8465 </span>                error = isSuccess.error;
<span class="lnr"> 8466 </span>                isSuccess = !error;
<span class="lnr"> 8467 </span>             }
<span class="lnr"> 8468 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 8469 </span><span class="Comment">             // We extract error from statusText</span>
<span class="lnr"> 8470 </span><span class="Comment">             // then normalize statusText and status for non-aborts</span>
<span class="lnr"> 8471 </span>             error = statusText;
<span class="lnr"> 8472 </span>             <span class="Statement">if</span> ( !statusText || status ) {
<span class="lnr"> 8473 </span>                statusText = <span class="Constant">&quot;error&quot;</span>;
<span class="lnr"> 8474 </span>                <span class="Statement">if</span> ( status &lt; <span class="Constant">0</span> ) {
<span class="lnr"> 8475 </span>                   status = <span class="Constant">0</span>;
<span class="lnr"> 8476 </span>                }
<span class="lnr"> 8477 </span>             }
<span class="lnr"> 8478 </span>          }
<span class="lnr"> 8479 </span>
<span class="lnr"> 8480 </span><span class="Comment">          // Set data for the fake xhr object</span>
<span class="lnr"> 8481 </span>          jqXHR.status = status;
<span class="lnr"> 8482 </span>          jqXHR.statusText = <span class="Constant">&quot;&quot;</span> + ( nativeStatusText || statusText );
<span class="lnr"> 8483 </span>
<span class="lnr"> 8484 </span><span class="Comment">          // Success/Error</span>
<span class="lnr"> 8485 </span>          <span class="Statement">if</span> ( isSuccess ) {
<span class="lnr"> 8486 </span>             deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
<span class="lnr"> 8487 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 8488 </span>             deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
<span class="lnr"> 8489 </span>          }
<span class="lnr"> 8490 </span>
<span class="lnr"> 8491 </span><span class="Comment">          // Status-dependent callbacks</span>
<span class="lnr"> 8492 </span>          jqXHR.statusCode( statusCode );
<span class="lnr"> 8493 </span>          statusCode = <span class="Type">undefined</span>;
<span class="lnr"> 8494 </span>
<span class="lnr"> 8495 </span>          <span class="Statement">if</span> ( fireGlobals ) {
<span class="lnr"> 8496 </span>             globalEventContext.trigger( <span class="Constant">&quot;ajax&quot;</span> + ( isSuccess ? <span class="Constant">&quot;Success&quot;</span> : <span class="Constant">&quot;Error&quot;</span> ),
<span class="lnr"> 8497 </span>                   [ jqXHR, s, isSuccess ? success : error ] );
<span class="lnr"> 8498 </span>          }
<span class="lnr"> 8499 </span>
<span class="lnr"> 8500 </span><span class="Comment">          // Complete</span>
<span class="lnr"> 8501 </span>          completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
<span class="lnr"> 8502 </span>
<span class="lnr"> 8503 </span>          <span class="Statement">if</span> ( fireGlobals ) {
<span class="lnr"> 8504 </span>             globalEventContext.trigger( <span class="Constant">&quot;ajaxComplete&quot;</span>, [ jqXHR, s ] );
<span class="lnr"> 8505 </span><span class="Comment">             // Handle the global AJAX counter</span>
<span class="lnr"> 8506 </span>             <span class="Statement">if</span> ( !( --jQuery.active ) ) {
<span class="lnr"> 8507 </span>                jQuery.event.trigger( <span class="Constant">&quot;ajaxStop&quot;</span> );
<span class="lnr"> 8508 </span>             }
<span class="lnr"> 8509 </span>          }
<span class="lnr"> 8510 </span>       }
<span class="lnr"> 8511 </span>
<span class="lnr"> 8512 </span><span class="Comment">       // Attach deferreds</span>
<span class="lnr"> 8513 </span>       deferred.promise( jqXHR );
<span class="lnr"> 8514 </span>       jqXHR.success = jqXHR.done;
<span class="lnr"> 8515 </span>       jqXHR.error = jqXHR.fail;
<span class="lnr"> 8516 </span>       jqXHR.complete = completeDeferred.add;
<span class="lnr"> 8517 </span>
<span class="lnr"> 8518 </span><span class="Comment">       // Status-dependent callbacks</span>
<span class="lnr"> 8519 </span>       jqXHR.statusCode = <span class="Identifier">function</span>( map ) {
<span class="lnr"> 8520 </span>          <span class="Statement">if</span> ( map ) {
<span class="lnr"> 8521 </span>             <span class="Type">var</span> tmp;
<span class="lnr"> 8522 </span>             <span class="Statement">if</span> ( state &lt; <span class="Constant">2</span> ) {
<span class="lnr"> 8523 </span>                <span class="Statement">for</span> ( tmp <span class="Statement">in</span> map ) {
<span class="lnr"> 8524 </span>                   statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
<span class="lnr"> 8525 </span>                }
<span class="lnr"> 8526 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 8527 </span>                tmp = map[ jqXHR.status ];
<span class="lnr"> 8528 </span>                jqXHR.always( tmp );
<span class="lnr"> 8529 </span>             }
<span class="lnr"> 8530 </span>          }
<span class="lnr"> 8531 </span>          <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 8532 </span>       };
<span class="lnr"> 8533 </span>
<span class="lnr"> 8534 </span><span class="Comment">       // Remove hash character (#7531: and string promotion)</span>
<span class="lnr"> 8535 </span><span class="Comment">       // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)</span>
<span class="lnr"> 8536 </span><span class="Comment">       // We also use the url parameter if available</span>
<span class="lnr"> 8537 </span>       s.url = ( ( url || s.url ) + <span class="Constant">&quot;&quot;</span> ).replace( rhash, <span class="Constant">&quot;&quot;</span> ).replace( rprotocol, ajaxLocParts[ <span class="Constant">1</span> ] + <span class="Constant">&quot;//&quot;</span> );
<span class="lnr"> 8538 </span>
<span class="lnr"> 8539 </span><span class="Comment">       // Extract dataTypes list</span>
<span class="lnr"> 8540 </span>       s.dataTypes = jQuery.trim( s.dataType || <span class="Constant">&quot;*&quot;</span> ).toLowerCase().split( core_rspace );
<span class="lnr"> 8541 </span>
<span class="lnr"> 8542 </span><span class="Comment">       // Determine if a cross-domain request is in order</span>
<span class="lnr"> 8543 </span>       <span class="Statement">if</span> ( s.crossDomain == <span class="Type">null</span> ) {
<span class="lnr"> 8544 </span>          parts = rurl.exec( s.url.toLowerCase() );
<span class="lnr"> 8545 </span>          s.crossDomain = !!( parts &amp;&amp;
<span class="lnr"> 8546 </span>             ( parts[ <span class="Constant">1</span> ] != ajaxLocParts[ <span class="Constant">1</span> ] || parts[ <span class="Constant">2</span> ] != ajaxLocParts[ <span class="Constant">2</span> ] ||
<span class="lnr"> 8547 </span>                ( parts[ <span class="Constant">3</span> ] || ( parts[ <span class="Constant">1</span> ] === <span class="Constant">&quot;http:&quot;</span> ? <span class="Constant">80</span> : <span class="Constant">443</span> ) ) !=
<span class="lnr"> 8548 </span>                   ( ajaxLocParts[ <span class="Constant">3</span> ] || ( ajaxLocParts[ <span class="Constant">1</span> ] === <span class="Constant">&quot;http:&quot;</span> ? <span class="Constant">80</span> : <span class="Constant">443</span> ) ) )
<span class="lnr"> 8549 </span>          );
<span class="lnr"> 8550 </span>       }
<span class="lnr"> 8551 </span>
<span class="lnr"> 8552 </span><span class="Comment">       // Convert data if not already a string</span>
<span class="lnr"> 8553 </span>       <span class="Statement">if</span> ( s.data &amp;&amp; s.processData &amp;&amp; <span class="Statement">typeof</span> s.data !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 8554 </span>          s.data = jQuery.param( s.data, s.traditional );
<span class="lnr"> 8555 </span>       }
<span class="lnr"> 8556 </span>
<span class="lnr"> 8557 </span><span class="Comment">       // Apply prefilters</span>
<span class="lnr"> 8558 </span>       inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
<span class="lnr"> 8559 </span>
<span class="lnr"> 8560 </span><span class="Comment">       // If request was aborted inside a prefilter, stop there</span>
<span class="lnr"> 8561 </span>       <span class="Statement">if</span> ( state === <span class="Constant">2</span> ) {
<span class="lnr"> 8562 </span>          <span class="Statement">return</span> jqXHR;
<span class="lnr"> 8563 </span>       }
<span class="lnr"> 8564 </span>
<span class="lnr"> 8565 </span><span class="Comment">       // We can fire global events as of now if asked to</span>
<span class="lnr"> 8566 </span>       fireGlobals = s.global;
<span class="lnr"> 8567 </span>
<span class="lnr"> 8568 </span><span class="Comment">       // Uppercase the type</span>
<span class="lnr"> 8569 </span>       s.type = s.type.toUpperCase();
<span class="lnr"> 8570 </span>
<span class="lnr"> 8571 </span><span class="Comment">       // Determine if request has content</span>
<span class="lnr"> 8572 </span>       s.hasContent = !rnoContent.test( s.type );
<span class="lnr"> 8573 </span>
<span class="lnr"> 8574 </span><span class="Comment">       // Watch for a new set of requests</span>
<span class="lnr"> 8575 </span>       <span class="Statement">if</span> ( fireGlobals &amp;&amp; jQuery.active++ === <span class="Constant">0</span> ) {
<span class="lnr"> 8576 </span>          jQuery.event.trigger( <span class="Constant">&quot;ajaxStart&quot;</span> );
<span class="lnr"> 8577 </span>       }
<span class="lnr"> 8578 </span>
<span class="lnr"> 8579 </span><span class="Comment">       // More options handling for requests with no content</span>
<span class="lnr"> 8580 </span>       <span class="Statement">if</span> ( !s.hasContent ) {
<span class="lnr"> 8581 </span>
<span class="lnr"> 8582 </span><span class="Comment">          // If data is available, append data to url</span>
<span class="lnr"> 8583 </span>          <span class="Statement">if</span> ( s.data ) {
<span class="lnr"> 8584 </span>             s.url += ( rquery.test( s.url ) ? <span class="Constant">&quot;&amp;&quot;</span> : <span class="Constant">&quot;?&quot;</span> ) + s.data;
<span class="lnr"> 8585 </span><span class="Comment">             // #9682: remove data so that it's not used in an eventual retry</span>
<span class="lnr"> 8586 </span>             <span class="Statement">delete</span> s.data;
<span class="lnr"> 8587 </span>          }
<span class="lnr"> 8588 </span>
<span class="lnr"> 8589 </span><span class="Comment">          // Get ifModifiedKey before adding the anti-cache parameter</span>
<span class="lnr"> 8590 </span>          ifModifiedKey = s.url;
<span class="lnr"> 8591 </span>
<span class="lnr"> 8592 </span><span class="Comment">          // Add anti-cache in url if needed</span>
<span class="lnr"> 8593 </span>          <span class="Statement">if</span> ( s.cache === <span class="Constant">false</span> ) {
<span class="lnr"> 8594 </span>
<span class="lnr"> 8595 </span>             <span class="Type">var</span> ts = jQuery.now(),
<span class="lnr"> 8596 </span><span class="Comment">                // try replacing _= if it is there</span>
<span class="lnr"> 8597 </span>                ret = s.url.replace( rts, <span class="Constant">&quot;$1_=&quot;</span> + ts );
<span class="lnr"> 8598 </span>
<span class="lnr"> 8599 </span><span class="Comment">             // if nothing was replaced, add timestamp to the end</span>
<span class="lnr"> 8600 </span>             s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? <span class="Constant">&quot;&amp;&quot;</span> : <span class="Constant">&quot;?&quot;</span> ) + <span class="Constant">&quot;_=&quot;</span> + <span class="Statement">ts</span> : <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 8601 </span>          }
<span class="lnr"> 8602 </span>       }
<span class="lnr"> 8603 </span>
<span class="lnr"> 8604 </span><span class="Comment">       // Set the correct header, if data is being sent</span>
<span class="lnr"> 8605 </span>       <span class="Statement">if</span> ( s.data &amp;&amp; s.hasContent &amp;&amp; s.contentType !== <span class="Constant">false</span> || options.contentType ) {
<span class="lnr"> 8606 </span>          jqXHR.setRequestHeader( <span class="Constant">&quot;Content-Type&quot;</span>, s.contentType );
<span class="lnr"> 8607 </span>       }
<span class="lnr"> 8608 </span>
<span class="lnr"> 8609 </span><span class="Comment">       // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.</span>
<span class="lnr"> 8610 </span>       <span class="Statement">if</span> ( s.ifModified ) {
<span class="lnr"> 8611 </span>          ifModifiedKey = ifModifiedKey || s.url;
<span class="lnr"> 8612 </span>          <span class="Statement">if</span> ( jQuery.lastModified[ ifModifiedKey ] ) {
<span class="lnr"> 8613 </span>             jqXHR.setRequestHeader( <span class="Constant">&quot;If-Modified-Since&quot;</span>, jQuery.lastModified[ ifModifiedKey ] );
<span class="lnr"> 8614 </span>          }
<span class="lnr"> 8615 </span>          <span class="Statement">if</span> ( jQuery.etag[ ifModifiedKey ] ) {
<span class="lnr"> 8616 </span>             jqXHR.setRequestHeader( <span class="Constant">&quot;If-None-Match&quot;</span>, jQuery.etag[ ifModifiedKey ] );
<span class="lnr"> 8617 </span>          }
<span class="lnr"> 8618 </span>       }
<span class="lnr"> 8619 </span>
<span class="lnr"> 8620 </span><span class="Comment">       // Set the Accepts header for the server, depending on the dataType</span>
<span class="lnr"> 8621 </span>       jqXHR.setRequestHeader(
<span class="lnr"> 8622 </span>          <span class="Constant">&quot;Accept&quot;</span>,
<span class="lnr"> 8623 </span>          s.dataTypes[ <span class="Constant">0</span> ] &amp;&amp; s.accepts[ s.dataTypes[<span class="Constant">0</span>] ] ?
<span class="lnr"> 8624 </span>             s.accepts[ s.dataTypes[<span class="Constant">0</span>] ] + ( s.dataTypes[ <span class="Constant">0</span> ] !== <span class="Constant">&quot;*&quot;</span> ? <span class="Constant">&quot;, &quot;</span> + allTypes + <span class="Constant">&quot;; q=0.01&quot;</span> : <span class="Constant">&quot;&quot;</span> ) :
<span class="lnr"> 8625 </span>             s.accepts[ <span class="Constant">&quot;*&quot;</span> ]
<span class="lnr"> 8626 </span>       );
<span class="lnr"> 8627 </span>
<span class="lnr"> 8628 </span><span class="Comment">       // Check for headers option</span>
<span class="lnr"> 8629 </span>       <span class="Statement">for</span> ( i <span class="Statement">in</span> s.headers ) {
<span class="lnr"> 8630 </span>          jqXHR.setRequestHeader( i, s.headers[ i ] );
<span class="lnr"> 8631 </span>       }
<span class="lnr"> 8632 </span>
<span class="lnr"> 8633 </span><span class="Comment">       // Allow custom headers/mimetypes and early abort</span>
<span class="lnr"> 8634 </span>       <span class="Statement">if</span> ( s.beforeSend &amp;&amp; ( s.beforeSend.call( callbackContext, jqXHR, s ) === <span class="Constant">false</span> || state === <span class="Constant">2</span> ) ) {
<span class="lnr"> 8635 </span><span class="Comment">             // Abort if not done already and return</span>
<span class="lnr"> 8636 </span>             <span class="Statement">return</span> jqXHR.abort();
<span class="lnr"> 8637 </span>
<span class="lnr"> 8638 </span>       }
<span class="lnr"> 8639 </span>
<span class="lnr"> 8640 </span><span class="Comment">       // aborting is no longer a cancellation</span>
<span class="lnr"> 8641 </span>       strAbort = <span class="Constant">&quot;abort&quot;</span>;
<span class="lnr"> 8642 </span>
<span class="lnr"> 8643 </span><span class="Comment">       // Install callbacks on deferreds</span>
<span class="lnr"> 8644 </span>       <span class="Statement">for</span> ( i <span class="Statement">in</span> { <span class="Statement">success</span>: <span class="Constant">1</span>, <span class="Statement">error</span>: <span class="Constant">1</span>, <span class="Statement">complete</span>: <span class="Constant">1</span> } ) {
<span class="lnr"> 8645 </span>          jqXHR[ i ]( s[ i ] );
<span class="lnr"> 8646 </span>       }
<span class="lnr"> 8647 </span>
<span class="lnr"> 8648 </span><span class="Comment">       // Get transport</span>
<span class="lnr"> 8649 </span>       transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
<span class="lnr"> 8650 </span>
<span class="lnr"> 8651 </span><span class="Comment">       // If no transport, we auto-abort</span>
<span class="lnr"> 8652 </span>       <span class="Statement">if</span> ( !transport ) {
<span class="lnr"> 8653 </span>          done( -<span class="Constant">1</span>, <span class="Constant">&quot;No Transport&quot;</span> );
<span class="lnr"> 8654 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 8655 </span>          jqXHR.readyState = <span class="Constant">1</span>;
<span class="lnr"> 8656 </span><span class="Comment">          // Send global event</span>
<span class="lnr"> 8657 </span>          <span class="Statement">if</span> ( fireGlobals ) {
<span class="lnr"> 8658 </span>             globalEventContext.trigger( <span class="Constant">&quot;ajaxSend&quot;</span>, [ jqXHR, s ] );
<span class="lnr"> 8659 </span>          }
<span class="lnr"> 8660 </span><span class="Comment">          // Timeout</span>
<span class="lnr"> 8661 </span>          <span class="Statement">if</span> ( s.async &amp;&amp; s.timeout &gt; <span class="Constant">0</span> ) {
<span class="lnr"> 8662 </span>             timeoutTimer = setTimeout( <span class="Identifier">function</span>(){
<span class="lnr"> 8663 </span>                jqXHR.abort( <span class="Constant">&quot;timeout&quot;</span> );
<span class="lnr"> 8664 </span>             }, s.timeout );
<span class="lnr"> 8665 </span>          }
<span class="lnr"> 8666 </span>
<span class="lnr"> 8667 </span>          <span class="Statement">try</span> {
<span class="lnr"> 8668 </span>             state = <span class="Constant">1</span>;
<span class="lnr"> 8669 </span>             transport.send( requestHeaders, done );
<span class="lnr"> 8670 </span>          } <span class="Statement">catch</span> (e) {
<span class="lnr"> 8671 </span><span class="Comment">             // Propagate exception as error if not done</span>
<span class="lnr"> 8672 </span>             <span class="Statement">if</span> ( state &lt; <span class="Constant">2</span> ) {
<span class="lnr"> 8673 </span>                done( -<span class="Constant">1</span>, e );
<span class="lnr"> 8674 </span><span class="Comment">             // Simply rethrow otherwise</span>
<span class="lnr"> 8675 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 8676 </span>                <span class="Statement">throw</span> e;
<span class="lnr"> 8677 </span>             }
<span class="lnr"> 8678 </span>          }
<span class="lnr"> 8679 </span>       }
<span class="lnr"> 8680 </span>
<span class="lnr"> 8681 </span>       <span class="Statement">return</span> jqXHR;
<span class="lnr"> 8682 </span>    },
<span class="lnr"> 8683 </span>
<span class="lnr"> 8684 </span><span class="Comment">    // Counter for holding the number of active queries</span>
<span class="lnr"> 8685 </span>    <span class="Statement">active</span>: <span class="Constant">0</span>,
<span class="lnr"> 8686 </span>
<span class="lnr"> 8687 </span><span class="Comment">    // Last-Modified header cache for next request</span>
<span class="lnr"> 8688 </span>    <span class="Statement">lastModified</span>: {},
<span class="lnr"> 8689 </span>    <span class="Statement">etag</span>: {}
<span class="lnr"> 8690 </span>
<span class="lnr"> 8691 </span>});
<span class="lnr"> 8692 </span>
<span class="lnr"> 8693 </span><span class="Comment">/* Handles responses to an ajax request:</span>
<span class="lnr"> 8694 </span><span class="Comment"> * - sets all responseXXX fields accordingly</span>
<span class="lnr"> 8695 </span><span class="Comment"> * - finds the right dataType (mediates between content-type and expected dataType)</span>
<span class="lnr"> 8696 </span><span class="Comment"> * - returns the corresponding response</span>
<span class="lnr"> 8697 </span><span class="Comment"> */</span>
<span class="lnr"> 8698 </span><span class="Identifier">function</span> ajaxHandleResponses( s, jqXHR, responses ) {
<span class="lnr"> 8699 </span>
<span class="lnr"> 8700 </span>    <span class="Type">var</span> ct, type, finalDataType, firstDataType,
<span class="lnr"> 8701 </span>       contents = s.contents,
<span class="lnr"> 8702 </span>       dataTypes = s.dataTypes,
<span class="lnr"> 8703 </span>       responseFields = s.responseFields;
<span class="lnr"> 8704 </span>
<span class="lnr"> 8705 </span><span class="Comment">    // Fill responseXXX fields</span>
<span class="lnr"> 8706 </span>    <span class="Statement">for</span> ( type <span class="Statement">in</span> responseFields ) {
<span class="lnr"> 8707 </span>       <span class="Statement">if</span> ( type <span class="Statement">in</span> responses ) {
<span class="lnr"> 8708 </span>          jqXHR[ responseFields[type] ] = responses[ type ];
<span class="lnr"> 8709 </span>       }
<span class="lnr"> 8710 </span>    }
<span class="lnr"> 8711 </span>
<span class="lnr"> 8712 </span><span class="Comment">    // Remove auto dataType and get content-type in the process</span>
<span class="lnr"> 8713 </span>    <span class="Statement">while</span>( dataTypes[ <span class="Constant">0</span> ] === <span class="Constant">&quot;*&quot;</span> ) {
<span class="lnr"> 8714 </span>       dataTypes.shift();
<span class="lnr"> 8715 </span>       <span class="Statement">if</span> ( ct === <span class="Type">undefined</span> ) {
<span class="lnr"> 8716 </span>          ct = s.mimeType || jqXHR.getResponseHeader( <span class="Constant">&quot;content-type&quot;</span> );
<span class="lnr"> 8717 </span>       }
<span class="lnr"> 8718 </span>    }
<span class="lnr"> 8719 </span>
<span class="lnr"> 8720 </span><span class="Comment">    // Check if we're dealing with a known content-type</span>
<span class="lnr"> 8721 </span>    <span class="Statement">if</span> ( ct ) {
<span class="lnr"> 8722 </span>       <span class="Statement">for</span> ( type <span class="Statement">in</span> contents ) {
<span class="lnr"> 8723 </span>          <span class="Statement">if</span> ( contents[ type ] &amp;&amp; contents[ type ].test( ct ) ) {
<span class="lnr"> 8724 </span>             dataTypes.unshift( type );
<span class="lnr"> 8725 </span>             <span class="Statement">break</span>;
<span class="lnr"> 8726 </span>          }
<span class="lnr"> 8727 </span>       }
<span class="lnr"> 8728 </span>    }
<span class="lnr"> 8729 </span>
<span class="lnr"> 8730 </span><span class="Comment">    // Check to see if we have a response for the expected dataType</span>
<span class="lnr"> 8731 </span>    <span class="Statement">if</span> ( dataTypes[ <span class="Constant">0</span> ] <span class="Statement">in</span> responses ) {
<span class="lnr"> 8732 </span>       finalDataType = dataTypes[ <span class="Constant">0</span> ];
<span class="lnr"> 8733 </span>    } <span class="Statement">else</span> {
<span class="lnr"> 8734 </span><span class="Comment">       // Try convertible dataTypes</span>
<span class="lnr"> 8735 </span>       <span class="Statement">for</span> ( type <span class="Statement">in</span> responses ) {
<span class="lnr"> 8736 </span>          <span class="Statement">if</span> ( !dataTypes[ <span class="Constant">0</span> ] || s.converters[ type + <span class="Constant">&quot; &quot;</span> + dataTypes[<span class="Constant">0</span>] ] ) {
<span class="lnr"> 8737 </span>             finalDataType = type;
<span class="lnr"> 8738 </span>             <span class="Statement">break</span>;
<span class="lnr"> 8739 </span>          }
<span class="lnr"> 8740 </span>          <span class="Statement">if</span> ( !firstDataType ) {
<span class="lnr"> 8741 </span>             firstDataType = type;
<span class="lnr"> 8742 </span>          }
<span class="lnr"> 8743 </span>       }
<span class="lnr"> 8744 </span><span class="Comment">       // Or just use first one</span>
<span class="lnr"> 8745 </span>       finalDataType = finalDataType || firstDataType;
<span class="lnr"> 8746 </span>    }
<span class="lnr"> 8747 </span>
<span class="lnr"> 8748 </span><span class="Comment">    // If we found a dataType</span>
<span class="lnr"> 8749 </span><span class="Comment">    // We add the dataType to the list if needed</span>
<span class="lnr"> 8750 </span><span class="Comment">    // and return the corresponding response</span>
<span class="lnr"> 8751 </span>    <span class="Statement">if</span> ( finalDataType ) {
<span class="lnr"> 8752 </span>       <span class="Statement">if</span> ( finalDataType !== dataTypes[ <span class="Constant">0</span> ] ) {
<span class="lnr"> 8753 </span>          dataTypes.unshift( finalDataType );
<span class="lnr"> 8754 </span>       }
<span class="lnr"> 8755 </span>       <span class="Statement">return</span> responses[ finalDataType ];
<span class="lnr"> 8756 </span>    }
<span class="lnr"> 8757 </span>}
<span class="lnr"> 8758 </span>
<span class="lnr"> 8759 </span><span class="Comment">// Chain conversions given the request and the original response</span>
<span class="lnr"> 8760 </span><span class="Identifier">function</span> ajaxConvert( s, response ) {
<span class="lnr"> 8761 </span>
<span class="lnr"> 8762 </span>    <span class="Type">var</span> conv, conv2, current, tmp,
<span class="lnr"> 8763 </span><span class="Comment">       // Work with a copy of dataTypes in case we need to modify it for conversion</span>
<span class="lnr"> 8764 </span>       dataTypes = s.dataTypes.slice(),
<span class="lnr"> 8765 </span>       prev = dataTypes[ <span class="Constant">0</span> ],
<span class="lnr"> 8766 </span>       converters = {},
<span class="lnr"> 8767 </span>       i = <span class="Constant">0</span>;
<span class="lnr"> 8768 </span>
<span class="lnr"> 8769 </span><span class="Comment">    // Apply the dataFilter if provided</span>
<span class="lnr"> 8770 </span>    <span class="Statement">if</span> ( s.dataFilter ) {
<span class="lnr"> 8771 </span>       response = s.dataFilter( response, s.dataType );
<span class="lnr"> 8772 </span>    }
<span class="lnr"> 8773 </span>
<span class="lnr"> 8774 </span><span class="Comment">    // Create converters map with lowercased keys</span>
<span class="lnr"> 8775 </span>    <span class="Statement">if</span> ( dataTypes[ <span class="Constant">1</span> ] ) {
<span class="lnr"> 8776 </span>       <span class="Statement">for</span> ( conv <span class="Statement">in</span> s.converters ) {
<span class="lnr"> 8777 </span>          converters[ conv.toLowerCase() ] = s.converters[ conv ];
<span class="lnr"> 8778 </span>       }
<span class="lnr"> 8779 </span>    }
<span class="lnr"> 8780 </span>
<span class="lnr"> 8781 </span><span class="Comment">    // Convert to each sequential dataType, tolerating list modification</span>
<span class="lnr"> 8782 </span>    <span class="Statement">for</span> ( ; (current = dataTypes[++i]); ) {
<span class="lnr"> 8783 </span>
<span class="lnr"> 8784 </span><span class="Comment">       // There's only work to do if current dataType is non-auto</span>
<span class="lnr"> 8785 </span>       <span class="Statement">if</span> ( current !== <span class="Constant">&quot;*&quot;</span> ) {
<span class="lnr"> 8786 </span>
<span class="lnr"> 8787 </span><span class="Comment">          // Convert response if prev dataType is non-auto and differs from current</span>
<span class="lnr"> 8788 </span>          <span class="Statement">if</span> ( prev !== <span class="Constant">&quot;*&quot;</span> &amp;&amp; prev !== current ) {
<span class="lnr"> 8789 </span>
<span class="lnr"> 8790 </span><span class="Comment">             // Seek a direct converter</span>
<span class="lnr"> 8791 </span>             conv = converters[ prev + <span class="Constant">&quot; &quot;</span> + current ] || converters[ <span class="Constant">&quot;* &quot;</span> + current ];
<span class="lnr"> 8792 </span>
<span class="lnr"> 8793 </span><span class="Comment">             // If none found, seek a pair</span>
<span class="lnr"> 8794 </span>             <span class="Statement">if</span> ( !conv ) {
<span class="lnr"> 8795 </span>                <span class="Statement">for</span> ( conv2 <span class="Statement">in</span> converters ) {
<span class="lnr"> 8796 </span>
<span class="lnr"> 8797 </span><span class="Comment">                   // If conv2 outputs current</span>
<span class="lnr"> 8798 </span>                   tmp = conv2.split(<span class="Constant">&quot; &quot;</span>);
<span class="lnr"> 8799 </span>                   <span class="Statement">if</span> ( tmp[ <span class="Constant">1</span> ] === current ) {
<span class="lnr"> 8800 </span>
<span class="lnr"> 8801 </span><span class="Comment">                      // If prev can be converted to accepted input</span>
<span class="lnr"> 8802 </span>                      conv = converters[ prev + <span class="Constant">&quot; &quot;</span> + tmp[ <span class="Constant">0</span> ] ] ||
<span class="lnr"> 8803 </span>                         converters[ <span class="Constant">&quot;* &quot;</span> + tmp[ <span class="Constant">0</span> ] ];
<span class="lnr"> 8804 </span>                      <span class="Statement">if</span> ( conv ) {
<span class="lnr"> 8805 </span><span class="Comment">                         // Condense equivalence converters</span>
<span class="lnr"> 8806 </span>                         <span class="Statement">if</span> ( conv === <span class="Constant">true</span> ) {
<span class="lnr"> 8807 </span>                            conv = converters[ conv2 ];
<span class="lnr"> 8808 </span>
<span class="lnr"> 8809 </span><span class="Comment">                         // Otherwise, insert the intermediate dataType</span>
<span class="lnr"> 8810 </span>                         } <span class="Statement">else</span> <span class="Statement">if</span> ( converters[ conv2 ] !== <span class="Constant">true</span> ) {
<span class="lnr"> 8811 </span>                            current = tmp[ <span class="Constant">0</span> ];
<span class="lnr"> 8812 </span>                            dataTypes.splice( i--, <span class="Constant">0</span>, current );
<span class="lnr"> 8813 </span>                         }
<span class="lnr"> 8814 </span>
<span class="lnr"> 8815 </span>                         <span class="Statement">break</span>;
<span class="lnr"> 8816 </span>                      }
<span class="lnr"> 8817 </span>                   }
<span class="lnr"> 8818 </span>                }
<span class="lnr"> 8819 </span>             }
<span class="lnr"> 8820 </span>
<span class="lnr"> 8821 </span><span class="Comment">             // Apply converter (if not an equivalence)</span>
<span class="lnr"> 8822 </span>             <span class="Statement">if</span> ( conv !== <span class="Constant">true</span> ) {
<span class="lnr"> 8823 </span>
<span class="lnr"> 8824 </span><span class="Comment">                // Unless errors are allowed to bubble, catch and return them</span>
<span class="lnr"> 8825 </span>                <span class="Statement">if</span> ( conv &amp;&amp; s[<span class="Constant">&quot;throws&quot;</span>] ) {
<span class="lnr"> 8826 </span>                   response = conv( response );
<span class="lnr"> 8827 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 8828 </span>                   <span class="Statement">try</span> {
<span class="lnr"> 8829 </span>                      response = conv( response );
<span class="lnr"> 8830 </span>                   } <span class="Statement">catch</span> ( e ) {
<span class="lnr"> 8831 </span>                      <span class="Statement">return</span> { <span class="Statement">state</span>: <span class="Constant">&quot;parsererror&quot;</span>, <span class="Statement">error</span>: conv ? e : <span class="Constant">&quot;No conversion from &quot;</span> + prev + <span class="Constant">&quot; to &quot;</span> + current };
<span class="lnr"> 8832 </span>                   }
<span class="lnr"> 8833 </span>                }
<span class="lnr"> 8834 </span>             }
<span class="lnr"> 8835 </span>          }
<span class="lnr"> 8836 </span>
<span class="lnr"> 8837 </span><span class="Comment">          // Update prev for next iteration</span>
<span class="lnr"> 8838 </span>          prev = current;
<span class="lnr"> 8839 </span>       }
<span class="lnr"> 8840 </span>    }
<span class="lnr"> 8841 </span>
<span class="lnr"> 8842 </span>    <span class="Statement">return</span> { <span class="Statement">state</span>: <span class="Constant">&quot;success&quot;</span>, <span class="Statement">data</span>: response };
<span class="lnr"> 8843 </span>}
<span class="lnr"> 8844 </span><span class="Type">var</span> oldCallbacks = [],
<span class="lnr"> 8845 </span>    rquestion = <span class="Constant">/</span><span class="Special">\?</span><span class="Constant">/</span>,
<span class="lnr"> 8846 </span>    rjsonp = <span class="Constant">/(=)</span><span class="Special">\?</span><span class="Constant">(?=&amp;|$)|</span><span class="Special">\?\?</span><span class="Constant">/</span>,
<span class="lnr"> 8847 </span>    nonce = jQuery.now();
<span class="lnr"> 8848 </span>
<span class="lnr"> 8849 </span><span class="Comment">// Default jsonp settings</span>
<span class="lnr"> 8850 </span>jQuery.ajaxSetup({
<span class="lnr"> 8851 </span>    <span class="Statement">jsonp</span>: <span class="Constant">&quot;callback&quot;</span>,
<span class="lnr"> 8852 </span>    <span class="Statement">jsonpCallback</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 8853 </span>       <span class="Type">var</span> callback = oldCallbacks.pop() || ( jQuery.expando + <span class="Constant">&quot;_&quot;</span> + ( nonce++ ) );
<span class="lnr"> 8854 </span>       <span class="Type">this</span>[ callback ] = <span class="Constant">true</span>;
<span class="lnr"> 8855 </span>       <span class="Statement">return</span> callback;
<span class="lnr"> 8856 </span>    }
<span class="lnr"> 8857 </span>});
<span class="lnr"> 8858 </span>
<span class="lnr"> 8859 </span><span class="Comment">// Detect, normalize options and install callbacks for jsonp requests</span>
<span class="lnr"> 8860 </span>jQuery.ajaxPrefilter( <span class="Constant">&quot;json jsonp&quot;</span>, <span class="Identifier">function</span>( s, originalSettings, jqXHR ) {
<span class="lnr"> 8861 </span>
<span class="lnr"> 8862 </span>    <span class="Type">var</span> callbackName, overwritten, responseContainer,
<span class="lnr"> 8863 </span>       data = s.data,
<span class="lnr"> 8864 </span>       url = s.url,
<span class="lnr"> 8865 </span>       hasCallback = s.jsonp !== <span class="Constant">false</span>,
<span class="lnr"> 8866 </span>       replaceInUrl = hasCallback &amp;&amp; rjsonp.test( url ),
<span class="lnr"> 8867 </span>       replaceInData = hasCallback &amp;&amp; !replaceInUrl &amp;&amp; <span class="Statement">typeof</span> data === <span class="Constant">&quot;string&quot;</span> &amp;&amp;
<span class="lnr"> 8868 </span>          !( s.contentType || <span class="Constant">&quot;&quot;</span> ).indexOf(<span class="Constant">&quot;application/x-www-form-urlencoded&quot;</span>) &amp;&amp;
<span class="lnr"> 8869 </span>          rjsonp.test( data );
<span class="lnr"> 8870 </span>
<span class="lnr"> 8871 </span><span class="Comment">    // Handle iff the expected data type is &quot;jsonp&quot; or we have a parameter to set</span>
<span class="lnr"> 8872 </span>    <span class="Statement">if</span> ( s.dataTypes[ <span class="Constant">0</span> ] === <span class="Constant">&quot;jsonp&quot;</span> || replaceInUrl || replaceInData ) {
<span class="lnr"> 8873 </span>
<span class="lnr"> 8874 </span><span class="Comment">       // Get callback name, remembering preexisting value associated with it</span>
<span class="lnr"> 8875 </span>       callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
<span class="lnr"> 8876 </span>          s.jsonpCallback() :
<span class="lnr"> 8877 </span>          s.jsonpCallback;
<span class="lnr"> 8878 </span>       overwritten = window[ callbackName ];
<span class="lnr"> 8879 </span>
<span class="lnr"> 8880 </span><span class="Comment">       // Insert callback into url or form data</span>
<span class="lnr"> 8881 </span>       <span class="Statement">if</span> ( replaceInUrl ) {
<span class="lnr"> 8882 </span>          s.url = url.replace( rjsonp, <span class="Constant">&quot;$1&quot;</span> + callbackName );
<span class="lnr"> 8883 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( replaceInData ) {
<span class="lnr"> 8884 </span>          s.data = data.replace( rjsonp, <span class="Constant">&quot;$1&quot;</span> + callbackName );
<span class="lnr"> 8885 </span>       } <span class="Statement">else</span> <span class="Statement">if</span> ( hasCallback ) {
<span class="lnr"> 8886 </span>          s.url += ( rquestion.test( url ) ? <span class="Constant">&quot;&amp;&quot;</span> : <span class="Constant">&quot;?&quot;</span> ) + s.jsonp + <span class="Constant">&quot;=&quot;</span> + callbackName;
<span class="lnr"> 8887 </span>       }
<span class="lnr"> 8888 </span>
<span class="lnr"> 8889 </span><span class="Comment">       // Use data converter to retrieve json after script execution</span>
<span class="lnr"> 8890 </span>       s.converters[<span class="Constant">&quot;script json&quot;</span>] = <span class="Identifier">function</span>() {
<span class="lnr"> 8891 </span>          <span class="Statement">if</span> ( !responseContainer ) {
<span class="lnr"> 8892 </span>             jQuery.error( callbackName + <span class="Constant">&quot; was not called&quot;</span> );
<span class="lnr"> 8893 </span>          }
<span class="lnr"> 8894 </span>          <span class="Statement">return</span> responseContainer[ <span class="Constant">0</span> ];
<span class="lnr"> 8895 </span>       };
<span class="lnr"> 8896 </span>
<span class="lnr"> 8897 </span><span class="Comment">       // force json dataType</span>
<span class="lnr"> 8898 </span>       s.dataTypes[ <span class="Constant">0</span> ] = <span class="Constant">&quot;json&quot;</span>;
<span class="lnr"> 8899 </span>
<span class="lnr"> 8900 </span><span class="Comment">       // Install callback</span>
<span class="lnr"> 8901 </span>       window[ callbackName ] = <span class="Identifier">function</span>() {
<span class="lnr"> 8902 </span>          responseContainer = arguments;
<span class="lnr"> 8903 </span>       };
<span class="lnr"> 8904 </span>
<span class="lnr"> 8905 </span><span class="Comment">       // Clean-up function (fires after converters)</span>
<span class="lnr"> 8906 </span>       jqXHR.always(<span class="Identifier">function</span>() {
<span class="lnr"> 8907 </span><span class="Comment">          // Restore preexisting value</span>
<span class="lnr"> 8908 </span>          window[ callbackName ] = overwritten;
<span class="lnr"> 8909 </span>
<span class="lnr"> 8910 </span><span class="Comment">          // Save back as free</span>
<span class="lnr"> 8911 </span>          <span class="Statement">if</span> ( s[ callbackName ] ) {
<span class="lnr"> 8912 </span><span class="Comment">             // make sure that re-using the options doesn't screw things around</span>
<span class="lnr"> 8913 </span>             s.jsonpCallback = originalSettings.jsonpCallback;
<span class="lnr"> 8914 </span>
<span class="lnr"> 8915 </span><span class="Comment">             // save the callback name for future use</span>
<span class="lnr"> 8916 </span>             oldCallbacks.push( callbackName );
<span class="lnr"> 8917 </span>          }
<span class="lnr"> 8918 </span>
<span class="lnr"> 8919 </span><span class="Comment">          // Call if it was a function and we have a response</span>
<span class="lnr"> 8920 </span>          <span class="Statement">if</span> ( responseContainer &amp;&amp; jQuery.isFunction( overwritten ) ) {
<span class="lnr"> 8921 </span>             overwritten( responseContainer[ <span class="Constant">0</span> ] );
<span class="lnr"> 8922 </span>          }
<span class="lnr"> 8923 </span>
<span class="lnr"> 8924 </span>          responseContainer = overwritten = <span class="Type">undefined</span>;
<span class="lnr"> 8925 </span>       });
<span class="lnr"> 8926 </span>
<span class="lnr"> 8927 </span><span class="Comment">       // Delegate to script</span>
<span class="lnr"> 8928 </span>       <span class="Statement">return</span> <span class="Constant">&quot;script&quot;</span>;
<span class="lnr"> 8929 </span>    }
<span class="lnr"> 8930 </span>});
<span class="lnr"> 8931 </span><span class="Comment">// Install script dataType</span>
<span class="lnr"> 8932 </span>jQuery.ajaxSetup({
<span class="lnr"> 8933 </span>    <span class="Statement">accepts</span>: {
<span class="lnr"> 8934 </span>       <span class="Statement">script</span>: <span class="Constant">&quot;text/javascript, application/javascript, application/ecmascript, application/x-ecmascript&quot;</span>
<span class="lnr"> 8935 </span>    },
<span class="lnr"> 8936 </span>    <span class="Statement">contents</span>: {
<span class="lnr"> 8937 </span>       <span class="Statement">script</span>: <span class="Constant">/javascript|ecmascript/</span>
<span class="lnr"> 8938 </span>    },
<span class="lnr"> 8939 </span>    <span class="Statement">converters</span>: {
<span class="lnr"> 8940 </span>       <span class="Constant">&quot;text script&quot;</span>: <span class="Identifier">function</span>( text ) {
<span class="lnr"> 8941 </span>          jQuery.globalEval( text );
<span class="lnr"> 8942 </span>          <span class="Statement">return</span> text;
<span class="lnr"> 8943 </span>       }
<span class="lnr"> 8944 </span>    }
<span class="lnr"> 8945 </span>});
<span class="lnr"> 8946 </span>
<span class="lnr"> 8947 </span><span class="Comment">// Handle cache's special case and global</span>
<span class="lnr"> 8948 </span>jQuery.ajaxPrefilter( <span class="Constant">&quot;script&quot;</span>, <span class="Identifier">function</span>( s ) {
<span class="lnr"> 8949 </span>    <span class="Statement">if</span> ( s.cache === <span class="Type">undefined</span> ) {
<span class="lnr"> 8950 </span>       s.cache = <span class="Constant">false</span>;
<span class="lnr"> 8951 </span>    }
<span class="lnr"> 8952 </span>    <span class="Statement">if</span> ( s.crossDomain ) {
<span class="lnr"> 8953 </span>       s.type = <span class="Constant">&quot;GET&quot;</span>;
<span class="lnr"> 8954 </span>       s.global = <span class="Constant">false</span>;
<span class="lnr"> 8955 </span>    }
<span class="lnr"> 8956 </span>});
<span class="lnr"> 8957 </span>
<span class="lnr"> 8958 </span><span class="Comment">// Bind script tag hack transport</span>
<span class="lnr"> 8959 </span>jQuery.ajaxTransport( <span class="Constant">&quot;script&quot;</span>, <span class="Identifier">function</span>(s) {
<span class="lnr"> 8960 </span>
<span class="lnr"> 8961 </span><span class="Comment">    // This transport only deals with cross domain requests</span>
<span class="lnr"> 8962 </span>    <span class="Statement">if</span> ( s.crossDomain ) {
<span class="lnr"> 8963 </span>
<span class="lnr"> 8964 </span>       <span class="Type">var</span> script,
<span class="lnr"> 8965 </span>          head = document.head || document.getElementsByTagName( <span class="Constant">&quot;head&quot;</span> )[<span class="Constant">0</span>] || document.documentElement;
<span class="lnr"> 8966 </span>
<span class="lnr"> 8967 </span>       <span class="Statement">return</span> {
<span class="lnr"> 8968 </span>
<span class="lnr"> 8969 </span>          <span class="Statement">send</span>: <span class="Identifier">function</span>( _, callback ) {
<span class="lnr"> 8970 </span>
<span class="lnr"> 8971 </span>             script = document.createElement( <span class="Constant">&quot;script&quot;</span> );
<span class="lnr"> 8972 </span>
<span class="lnr"> 8973 </span>             script.async = <span class="Constant">&quot;async&quot;</span>;
<span class="lnr"> 8974 </span>
<span class="lnr"> 8975 </span>             <span class="Statement">if</span> ( s.scriptCharset ) {
<span class="lnr"> 8976 </span>                script.charset = s.scriptCharset;
<span class="lnr"> 8977 </span>             }
<span class="lnr"> 8978 </span>
<span class="lnr"> 8979 </span>             script.src = s.url;
<span class="lnr"> 8980 </span>
<span class="lnr"> 8981 </span><span class="Comment">             // Attach handlers for all browsers</span>
<span class="lnr"> 8982 </span>             script.onload = script.onreadystatechange = <span class="Identifier">function</span>( _, isAbort ) {
<span class="lnr"> 8983 </span>
<span class="lnr"> 8984 </span>                <span class="Statement">if</span> ( isAbort || !script.readyState || <span class="Constant">/loaded|complete/</span>.test( script.readyState ) ) {
<span class="lnr"> 8985 </span>
<span class="lnr"> 8986 </span><span class="Comment">                   // Handle memory leak in IE</span>
<span class="lnr"> 8987 </span>                   script.onload = script.onreadystatechange = <span class="Type">null</span>;
<span class="lnr"> 8988 </span>
<span class="lnr"> 8989 </span><span class="Comment">                   // Remove the script</span>
<span class="lnr"> 8990 </span>                   <span class="Statement">if</span> ( head &amp;&amp; script.parentNode ) {
<span class="lnr"> 8991 </span>                      head.removeChild( script );
<span class="lnr"> 8992 </span>                   }
<span class="lnr"> 8993 </span>
<span class="lnr"> 8994 </span><span class="Comment">                   // Dereference the script</span>
<span class="lnr"> 8995 </span>                   script = <span class="Type">undefined</span>;
<span class="lnr"> 8996 </span>
<span class="lnr"> 8997 </span><span class="Comment">                   // Callback if not abort</span>
<span class="lnr"> 8998 </span>                   <span class="Statement">if</span> ( !isAbort ) {
<span class="lnr"> 8999 </span>                      callback( <span class="Constant">200</span>, <span class="Constant">&quot;success&quot;</span> );
<span class="lnr"> 9000 </span>                   }
<span class="lnr"> 9001 </span>                }
<span class="lnr"> 9002 </span>             };
<span class="lnr"> 9003 </span><span class="Comment">             // Use insertBefore instead of appendChild  to circumvent an IE6 bug.</span>
<span class="lnr"> 9004 </span><span class="Comment">             // This arises when a base node is used (#2709 and #4378).</span>
<span class="lnr"> 9005 </span>             head.insertBefore( script, head.firstChild );
<span class="lnr"> 9006 </span>          },
<span class="lnr"> 9007 </span>
<span class="lnr"> 9008 </span>          <span class="Statement">abort</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 9009 </span>             <span class="Statement">if</span> ( script ) {
<span class="lnr"> 9010 </span>                script.onload( <span class="Constant">0</span>, <span class="Constant">1</span> );
<span class="lnr"> 9011 </span>             }
<span class="lnr"> 9012 </span>          }
<span class="lnr"> 9013 </span>       };
<span class="lnr"> 9014 </span>    }
<span class="lnr"> 9015 </span>});
<span class="lnr"> 9016 </span><span class="Type">var</span> xhrCallbacks,
<span class="lnr"> 9017 </span><span class="Comment">    // #5280: Internet Explorer will keep connections alive if we don't abort on unload</span>
<span class="lnr"> 9018 </span>    xhrOnUnloadAbort = window.ActiveXObject ? <span class="Identifier">function</span>() {
<span class="lnr"> 9019 </span><span class="Comment">       // Abort all pending requests</span>
<span class="lnr"> 9020 </span>       <span class="Statement">for</span> ( <span class="Type">var</span> key <span class="Statement">in</span> xhrCallbacks ) {
<span class="lnr"> 9021 </span>          xhrCallbacks[ key ]( <span class="Constant">0</span>, <span class="Constant">1</span> );
<span class="lnr"> 9022 </span>       }
<span class="lnr"> 9023 </span>    } : <span class="Constant">false</span>,
<span class="lnr"> 9024 </span>    xhrId = <span class="Constant">0</span>;
<span class="lnr"> 9025 </span>
<span class="lnr"> 9026 </span><span class="Comment">// Functions to create xhrs</span>
<span class="lnr"> 9027 </span><span class="Identifier">function</span> createStandardXHR() {
<span class="lnr"> 9028 </span>    <span class="Statement">try</span> {
<span class="lnr"> 9029 </span>       <span class="Statement">return</span> <span class="Statement">new</span> window.XMLHttpRequest();
<span class="lnr"> 9030 </span>    } <span class="Statement">catch</span>( e ) {}
<span class="lnr"> 9031 </span>}
<span class="lnr"> 9032 </span>
<span class="lnr"> 9033 </span><span class="Identifier">function</span> createActiveXHR() {
<span class="lnr"> 9034 </span>    <span class="Statement">try</span> {
<span class="lnr"> 9035 </span>       <span class="Statement">return</span> <span class="Statement">new</span> window.ActiveXObject( <span class="Constant">&quot;Microsoft.XMLHTTP&quot;</span> );
<span class="lnr"> 9036 </span>    } <span class="Statement">catch</span>( e ) {}
<span class="lnr"> 9037 </span>}
<span class="lnr"> 9038 </span>
<span class="lnr"> 9039 </span><span class="Comment">// Create the request object</span>
<span class="lnr"> 9040 </span><span class="Comment">// (This is still attached to ajaxSettings for backward compatibility)</span>
<span class="lnr"> 9041 </span>jQuery.ajaxSettings.xhr = window.ActiveXObject ?
<span class="lnr"> 9042 </span>    <span class="Comment">/* Microsoft failed to properly</span>
<span class="lnr"> 9043 </span><span class="Comment">     * implement the XMLHttpRequest in IE7 (can't request local files),</span>
<span class="lnr"> 9044 </span><span class="Comment">     * so we use the ActiveXObject when it is available</span>
<span class="lnr"> 9045 </span><span class="Comment">     * Additionally XMLHttpRequest can be disabled in IE7/IE8 so</span>
<span class="lnr"> 9046 </span><span class="Comment">     * we need a fallback.</span>
<span class="lnr"> 9047 </span><span class="Comment">     */</span>
<span class="lnr"> 9048 </span>    <span class="Identifier">function</span>() {
<span class="lnr"> 9049 </span>       <span class="Statement">return</span> !<span class="Type">this</span>.isLocal &amp;&amp; createStandardXHR() || createActiveXHR();
<span class="lnr"> 9050 </span>    } :
<span class="lnr"> 9051 </span><span class="Comment">    // For all other browsers, use the standard XMLHttpRequest object</span>
<span class="lnr"> 9052 </span>    createStandardXHR;
<span class="lnr"> 9053 </span>
<span class="lnr"> 9054 </span><span class="Comment">// Determine support properties</span>
<span class="lnr"> 9055 </span>(<span class="Identifier">function</span>( xhr ) {
<span class="lnr"> 9056 </span>    jQuery.extend( jQuery.support, {
<span class="lnr"> 9057 </span>       <span class="Statement">ajax</span>: !!xhr,
<span class="lnr"> 9058 </span>       <span class="Statement">cors</span>: !!xhr &amp;&amp; ( <span class="Constant">&quot;withCredentials&quot;</span> <span class="Statement">in</span> xhr )
<span class="lnr"> 9059 </span>    });
<span class="lnr"> 9060 </span>})( jQuery.ajaxSettings.xhr() );
<span class="lnr"> 9061 </span>
<span class="lnr"> 9062 </span><span class="Comment">// Create transport if the browser can provide an xhr</span>
<span class="lnr"> 9063 </span><span class="Statement">if</span> ( jQuery.support.ajax ) {
<span class="lnr"> 9064 </span>
<span class="lnr"> 9065 </span>    jQuery.ajaxTransport(<span class="Identifier">function</span>( s ) {
<span class="lnr"> 9066 </span><span class="Comment">       // Cross domain only allowed if supported through XMLHttpRequest</span>
<span class="lnr"> 9067 </span>       <span class="Statement">if</span> ( !s.crossDomain || jQuery.support.cors ) {
<span class="lnr"> 9068 </span>
<span class="lnr"> 9069 </span>          <span class="Type">var</span> callback;
<span class="lnr"> 9070 </span>
<span class="lnr"> 9071 </span>          <span class="Statement">return</span> {
<span class="lnr"> 9072 </span>             <span class="Statement">send</span>: <span class="Identifier">function</span>( headers, complete ) {
<span class="lnr"> 9073 </span>
<span class="lnr"> 9074 </span><span class="Comment">                // Get a new xhr</span>
<span class="lnr"> 9075 </span>                <span class="Type">var</span> handle, i,
<span class="lnr"> 9076 </span>                   xhr = s.xhr();
<span class="lnr"> 9077 </span>
<span class="lnr"> 9078 </span><span class="Comment">                // Open the socket</span>
<span class="lnr"> 9079 </span><span class="Comment">                // Passing null username, generates a login popup on Opera (#2865)</span>
<span class="lnr"> 9080 </span>                <span class="Statement">if</span> ( s.username ) {
<span class="lnr"> 9081 </span>                   xhr.open( s.type, s.url, s.async, s.username, s.password );
<span class="lnr"> 9082 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 9083 </span>                   xhr.open( s.type, s.url, s.async );
<span class="lnr"> 9084 </span>                }
<span class="lnr"> 9085 </span>
<span class="lnr"> 9086 </span><span class="Comment">                // Apply custom fields if provided</span>
<span class="lnr"> 9087 </span>                <span class="Statement">if</span> ( s.xhrFields ) {
<span class="lnr"> 9088 </span>                   <span class="Statement">for</span> ( i <span class="Statement">in</span> s.xhrFields ) {
<span class="lnr"> 9089 </span>                      xhr[ i ] = s.xhrFields[ i ];
<span class="lnr"> 9090 </span>                   }
<span class="lnr"> 9091 </span>                }
<span class="lnr"> 9092 </span>
<span class="lnr"> 9093 </span><span class="Comment">                // Override mime type if needed</span>
<span class="lnr"> 9094 </span>                <span class="Statement">if</span> ( s.mimeType &amp;&amp; xhr.overrideMimeType ) {
<span class="lnr"> 9095 </span>                   xhr.overrideMimeType( s.mimeType );
<span class="lnr"> 9096 </span>                }
<span class="lnr"> 9097 </span>
<span class="lnr"> 9098 </span><span class="Comment">                // X-Requested-With header</span>
<span class="lnr"> 9099 </span><span class="Comment">                // For cross-domain requests, seeing as conditions for a preflight are</span>
<span class="lnr"> 9100 </span><span class="Comment">                // akin to a jigsaw puzzle, we simply never set it to be sure.</span>
<span class="lnr"> 9101 </span><span class="Comment">                // (it can always be set on a per-request basis or even using ajaxSetup)</span>
<span class="lnr"> 9102 </span><span class="Comment">                // For same-domain requests, won't change header if already provided.</span>
<span class="lnr"> 9103 </span>                <span class="Statement">if</span> ( !s.crossDomain &amp;&amp; !headers[<span class="Constant">&quot;X-Requested-With&quot;</span>] ) {
<span class="lnr"> 9104 </span>                   headers[ <span class="Constant">&quot;X-Requested-With&quot;</span> ] = <span class="Constant">&quot;XMLHttpRequest&quot;</span>;
<span class="lnr"> 9105 </span>                }
<span class="lnr"> 9106 </span>
<span class="lnr"> 9107 </span><span class="Comment">                // Need an extra try/catch for cross domain requests in Firefox 3</span>
<span class="lnr"> 9108 </span>                <span class="Statement">try</span> {
<span class="lnr"> 9109 </span>                   <span class="Statement">for</span> ( i <span class="Statement">in</span> headers ) {
<span class="lnr"> 9110 </span>                      xhr.setRequestHeader( i, headers[ i ] );
<span class="lnr"> 9111 </span>                   }
<span class="lnr"> 9112 </span>                } <span class="Statement">catch</span>( _ ) {}
<span class="lnr"> 9113 </span>
<span class="lnr"> 9114 </span><span class="Comment">                // Do send the request</span>
<span class="lnr"> 9115 </span><span class="Comment">                // This may raise an exception which is actually</span>
<span class="lnr"> 9116 </span><span class="Comment">                // handled in jQuery.ajax (so no try/catch here)</span>
<span class="lnr"> 9117 </span>                xhr.send( ( s.hasContent &amp;&amp; s.data ) || <span class="Type">null</span> );
<span class="lnr"> 9118 </span>
<span class="lnr"> 9119 </span><span class="Comment">                // Listener</span>
<span class="lnr"> 9120 </span>                callback = <span class="Identifier">function</span>( _, isAbort ) {
<span class="lnr"> 9121 </span>
<span class="lnr"> 9122 </span>                   <span class="Type">var</span> status,
<span class="lnr"> 9123 </span>                      statusText,
<span class="lnr"> 9124 </span>                      responseHeaders,
<span class="lnr"> 9125 </span>                      responses,
<span class="lnr"> 9126 </span>                      xml;
<span class="lnr"> 9127 </span>
<span class="lnr"> 9128 </span><span class="Comment">                   // Firefox throws exceptions when accessing properties</span>
<span class="lnr"> 9129 </span><span class="Comment">                   // of an xhr when a network error occurred</span>
<span class="lnr"> 9130 </span><span class="Comment">                   // <a href="http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)">http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)</a></span>
<span class="lnr"> 9131 </span>                   <span class="Statement">try</span> {
<span class="lnr"> 9132 </span>
<span class="lnr"> 9133 </span><span class="Comment">                      // Was never called and is aborted or complete</span>
<span class="lnr"> 9134 </span>                      <span class="Statement">if</span> ( callback &amp;&amp; ( isAbort || xhr.readyState === <span class="Constant">4</span> ) ) {
<span class="lnr"> 9135 </span>
<span class="lnr"> 9136 </span><span class="Comment">                         // Only called once</span>
<span class="lnr"> 9137 </span>                         callback = <span class="Type">undefined</span>;
<span class="lnr"> 9138 </span>
<span class="lnr"> 9139 </span><span class="Comment">                         // Do not keep as active anymore</span>
<span class="lnr"> 9140 </span>                         <span class="Statement">if</span> ( handle ) {
<span class="lnr"> 9141 </span>                            xhr.onreadystatechange = jQuery.noop;
<span class="lnr"> 9142 </span>                            <span class="Statement">if</span> ( xhrOnUnloadAbort ) {
<span class="lnr"> 9143 </span>                               <span class="Statement">delete</span> xhrCallbacks[ handle ];
<span class="lnr"> 9144 </span>                            }
<span class="lnr"> 9145 </span>                         }
<span class="lnr"> 9146 </span>
<span class="lnr"> 9147 </span><span class="Comment">                         // If it's an abort</span>
<span class="lnr"> 9148 </span>                         <span class="Statement">if</span> ( isAbort ) {
<span class="lnr"> 9149 </span><span class="Comment">                            // Abort it manually if needed</span>
<span class="lnr"> 9150 </span>                            <span class="Statement">if</span> ( xhr.readyState !== <span class="Constant">4</span> ) {
<span class="lnr"> 9151 </span>                               xhr.abort();
<span class="lnr"> 9152 </span>                            }
<span class="lnr"> 9153 </span>                         } <span class="Statement">else</span> {
<span class="lnr"> 9154 </span>                            status = xhr.status;
<span class="lnr"> 9155 </span>                            responseHeaders = xhr.getAllResponseHeaders();
<span class="lnr"> 9156 </span>                            responses = {};
<span class="lnr"> 9157 </span>                            xml = xhr.responseXML;
<span class="lnr"> 9158 </span>
<span class="lnr"> 9159 </span><span class="Comment">                            // Construct response list</span>
<span class="lnr"> 9160 </span>                            <span class="Statement">if</span> ( xml &amp;&amp; xml.documentElement <span class="Comment">/* #4958 */</span> ) {
<span class="lnr"> 9161 </span>                               responses.xml = xml;
<span class="lnr"> 9162 </span>                            }
<span class="lnr"> 9163 </span>
<span class="lnr"> 9164 </span><span class="Comment">                            // When requesting binary data, IE6-9 will throw an exception</span>
<span class="lnr"> 9165 </span><span class="Comment">                            // on any attempt to access responseText (#11426)</span>
<span class="lnr"> 9166 </span>                            <span class="Statement">try</span> {
<span class="lnr"> 9167 </span>                               responses.text = xhr.responseText;
<span class="lnr"> 9168 </span>                            } <span class="Statement">catch</span>( _ ) {
<span class="lnr"> 9169 </span>                            }
<span class="lnr"> 9170 </span>
<span class="lnr"> 9171 </span><span class="Comment">                            // Firefox throws an exception when accessing</span>
<span class="lnr"> 9172 </span><span class="Comment">                            // statusText for faulty cross-domain requests</span>
<span class="lnr"> 9173 </span>                            <span class="Statement">try</span> {
<span class="lnr"> 9174 </span>                               statusText = xhr.statusText;
<span class="lnr"> 9175 </span>                            } <span class="Statement">catch</span>( e ) {
<span class="lnr"> 9176 </span><span class="Comment">                               // We normalize with Webkit giving an empty statusText</span>
<span class="lnr"> 9177 </span>                               statusText = <span class="Constant">&quot;&quot;</span>;
<span class="lnr"> 9178 </span>                            }
<span class="lnr"> 9179 </span>
<span class="lnr"> 9180 </span><span class="Comment">                            // Filter status for non standard behaviors</span>
<span class="lnr"> 9181 </span>
<span class="lnr"> 9182 </span><span class="Comment">                            // If the request is local and we have data: assume a success</span>
<span class="lnr"> 9183 </span><span class="Comment">                            // (success with no data won't get notified, that's the best we</span>
<span class="lnr"> 9184 </span><span class="Comment">                            // can do given current implementations)</span>
<span class="lnr"> 9185 </span>                            <span class="Statement">if</span> ( !status &amp;&amp; s.isLocal &amp;&amp; !s.crossDomain ) {
<span class="lnr"> 9186 </span>                               status = responses.text ? <span class="Constant">200</span> : <span class="Constant">404</span>;
<span class="lnr"> 9187 </span><span class="Comment">                            // IE - #1450: sometimes returns 1223 when it should be 204</span>
<span class="lnr"> 9188 </span>                            } <span class="Statement">else</span> <span class="Statement">if</span> ( status === <span class="Constant">1223</span> ) {
<span class="lnr"> 9189 </span>                               status = <span class="Constant">204</span>;
<span class="lnr"> 9190 </span>                            }
<span class="lnr"> 9191 </span>                         }
<span class="lnr"> 9192 </span>                      }
<span class="lnr"> 9193 </span>                   } <span class="Statement">catch</span>( firefoxAccessException ) {
<span class="lnr"> 9194 </span>                      <span class="Statement">if</span> ( !isAbort ) {
<span class="lnr"> 9195 </span>                         complete( -<span class="Constant">1</span>, firefoxAccessException );
<span class="lnr"> 9196 </span>                      }
<span class="lnr"> 9197 </span>                   }
<span class="lnr"> 9198 </span>
<span class="lnr"> 9199 </span><span class="Comment">                   // Call complete if needed</span>
<span class="lnr"> 9200 </span>                   <span class="Statement">if</span> ( responses ) {
<span class="lnr"> 9201 </span>                      complete( status, statusText, responses, responseHeaders );
<span class="lnr"> 9202 </span>                   }
<span class="lnr"> 9203 </span>                };
<span class="lnr"> 9204 </span>
<span class="lnr"> 9205 </span>                <span class="Statement">if</span> ( !s.async ) {
<span class="lnr"> 9206 </span><span class="Comment">                   // if we're in sync mode we fire the callback</span>
<span class="lnr"> 9207 </span>                   callback();
<span class="lnr"> 9208 </span>                } <span class="Statement">else</span> <span class="Statement">if</span> ( xhr.readyState === <span class="Constant">4</span> ) {
<span class="lnr"> 9209 </span><span class="Comment">                   // (IE6 &amp; IE7) if it's in cache and has been</span>
<span class="lnr"> 9210 </span><span class="Comment">                   // retrieved directly we need to fire the callback</span>
<span class="lnr"> 9211 </span>                   setTimeout( callback, <span class="Constant">0</span> );
<span class="lnr"> 9212 </span>                } <span class="Statement">else</span> {
<span class="lnr"> 9213 </span>                   handle = ++xhrId;
<span class="lnr"> 9214 </span>                   <span class="Statement">if</span> ( xhrOnUnloadAbort ) {
<span class="lnr"> 9215 </span><span class="Comment">                      // Create the active xhrs callbacks list if needed</span>
<span class="lnr"> 9216 </span><span class="Comment">                      // and attach the unload handler</span>
<span class="lnr"> 9217 </span>                      <span class="Statement">if</span> ( !xhrCallbacks ) {
<span class="lnr"> 9218 </span>                         xhrCallbacks = {};
<span class="lnr"> 9219 </span>                         jQuery( window ).unload( xhrOnUnloadAbort );
<span class="lnr"> 9220 </span>                      }
<span class="lnr"> 9221 </span><span class="Comment">                      // Add to list of active xhrs callbacks</span>
<span class="lnr"> 9222 </span>                      xhrCallbacks[ handle ] = callback;
<span class="lnr"> 9223 </span>                   }
<span class="lnr"> 9224 </span>                   xhr.onreadystatechange = callback;
<span class="lnr"> 9225 </span>                }
<span class="lnr"> 9226 </span>             },
<span class="lnr"> 9227 </span>
<span class="lnr"> 9228 </span>             <span class="Statement">abort</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 9229 </span>                <span class="Statement">if</span> ( callback ) {
<span class="lnr"> 9230 </span>                   callback(<span class="Constant">0</span>,<span class="Constant">1</span>);
<span class="lnr"> 9231 </span>                }
<span class="lnr"> 9232 </span>             }
<span class="lnr"> 9233 </span>          };
<span class="lnr"> 9234 </span>       }
<span class="lnr"> 9235 </span>    });
<span class="lnr"> 9236 </span>}
<span class="lnr"> 9237 </span><span class="Type">var</span> fxNow, timerId,
<span class="lnr"> 9238 </span>    rfxtypes = <span class="Constant">/^(?:toggle|show|hide)$/</span>,
<span class="lnr"> 9239 </span>    rfxnum = <span class="Statement">new</span> <span class="Special">RegExp</span>( <span class="Constant">&quot;^(?:([-+])=|)(&quot;</span> + core_pnum + <span class="Constant">&quot;)([a-z%]*)$&quot;</span>, <span class="Constant">&quot;i&quot;</span> ),
<span class="lnr"> 9240 </span>    rrun = <span class="Constant">/queueHooks$/</span>,
<span class="lnr"> 9241 </span>    animationPrefilters = [ defaultPrefilter ],
<span class="lnr"> 9242 </span>    tweeners = {
<span class="lnr"> 9243 </span>       <span class="Constant">&quot;*&quot;</span>: [<span class="Identifier">function</span>( prop, value ) {
<span class="lnr"> 9244 </span>          <span class="Type">var</span> end, unit, prevScale,
<span class="lnr"> 9245 </span>             tween = <span class="Type">this</span>.createTween( prop, value ),
<span class="lnr"> 9246 </span>             parts = rfxnum.exec( value ),
<span class="lnr"> 9247 </span>             target = tween.cur(),
<span class="lnr"> 9248 </span>             start = +target || <span class="Constant">0</span>,
<span class="lnr"> 9249 </span>             scale = <span class="Constant">1</span>;
<span class="lnr"> 9250 </span>
<span class="lnr"> 9251 </span>          <span class="Statement">if</span> ( parts ) {
<span class="lnr"> 9252 </span>             end = +parts[<span class="Constant">2</span>];
<span class="lnr"> 9253 </span>             unit = parts[<span class="Constant">3</span>] || ( jQuery.cssNumber[ prop ] ? <span class="Constant">&quot;&quot;</span> : <span class="Constant">&quot;px&quot;</span> );
<span class="lnr"> 9254 </span>
<span class="lnr"> 9255 </span><span class="Comment">             // We need to compute starting value</span>
<span class="lnr"> 9256 </span>             <span class="Statement">if</span> ( unit !== <span class="Constant">&quot;px&quot;</span> &amp;&amp; start ) {
<span class="lnr"> 9257 </span><span class="Comment">                // Iteratively approximate from a nonzero starting point</span>
<span class="lnr"> 9258 </span><span class="Comment">                // Prefer the current property, because this process will be trivial if it uses the same units</span>
<span class="lnr"> 9259 </span><span class="Comment">                // Fallback to end or a simple constant</span>
<span class="lnr"> 9260 </span>                start = jQuery.css( tween.elem, prop, <span class="Constant">true</span> ) || end || <span class="Constant">1</span>;
<span class="lnr"> 9261 </span>
<span class="lnr"> 9262 </span>                <span class="Statement">do</span> {
<span class="lnr"> 9263 </span><span class="Comment">                   // If previous iteration zeroed out, double until we get *something*</span>
<span class="lnr"> 9264 </span><span class="Comment">                   // Use a string for doubling factor so we don't accidentally see scale as unchanged below</span>
<span class="lnr"> 9265 </span>                   prevScale = scale = scale || <span class="Constant">&quot;.5&quot;</span>;
<span class="lnr"> 9266 </span>
<span class="lnr"> 9267 </span><span class="Comment">                   // Adjust and apply</span>
<span class="lnr"> 9268 </span>                   start = start / scale;
<span class="lnr"> 9269 </span>                   jQuery.style( tween.elem, prop, start + unit );
<span class="lnr"> 9270 </span>
<span class="lnr"> 9271 </span><span class="Comment">                   // Update scale, tolerating zeroes from tween.cur()</span>
<span class="lnr"> 9272 </span>                   scale = tween.cur() / target;
<span class="lnr"> 9273 </span>
<span class="lnr"> 9274 </span><span class="Comment">                // Stop looping if we've hit the mark or scale is unchanged</span>
<span class="lnr"> 9275 </span>                } <span class="Statement">while</span> ( scale !== <span class="Constant">1</span> &amp;&amp; scale !== prevScale );
<span class="lnr"> 9276 </span>             }
<span class="lnr"> 9277 </span>
<span class="lnr"> 9278 </span>             tween.unit = unit;
<span class="lnr"> 9279 </span>             tween.start = start;
<span class="lnr"> 9280 </span><span class="Comment">             // If a +=/-= token was provided, we're doing a relative animation</span>
<span class="lnr"> 9281 </span>             tween.end = parts[<span class="Constant">1</span>] ? start + ( parts[<span class="Constant">1</span>] + <span class="Constant">1</span> ) * <span class="Statement">end</span> : end;
<span class="lnr"> 9282 </span>          }
<span class="lnr"> 9283 </span>          <span class="Statement">return</span> tween;
<span class="lnr"> 9284 </span>       }]
<span class="lnr"> 9285 </span>    };
<span class="lnr"> 9286 </span>
<span class="lnr"> 9287 </span><span class="Comment">// Animations created synchronously will run synchronously</span>
<span class="lnr"> 9288 </span><span class="Identifier">function</span> createFxNow() {
<span class="lnr"> 9289 </span>    setTimeout(<span class="Identifier">function</span>() {
<span class="lnr"> 9290 </span>       fxNow = <span class="Type">undefined</span>;
<span class="lnr"> 9291 </span>    }, <span class="Constant">0</span> );
<span class="lnr"> 9292 </span>    <span class="Statement">return</span> ( fxNow = jQuery.now() );
<span class="lnr"> 9293 </span>}
<span class="lnr"> 9294 </span>
<span class="lnr"> 9295 </span><span class="Identifier">function</span> createTweens( animation, props ) {
<span class="lnr"> 9296 </span>    jQuery.each( props, <span class="Identifier">function</span>( prop, value ) {
<span class="lnr"> 9297 </span>       <span class="Type">var</span> collection = ( tweeners[ prop ] || [] ).concat( tweeners[ <span class="Constant">&quot;*&quot;</span> ] ),
<span class="lnr"> 9298 </span>          index = <span class="Constant">0</span>,
<span class="lnr"> 9299 </span>          length = collection.length;
<span class="lnr"> 9300 </span>       <span class="Statement">for</span> ( ; index &lt; length; index++ ) {
<span class="lnr"> 9301 </span>          <span class="Statement">if</span> ( collection[ index ].call( animation, prop, value ) ) {
<span class="lnr"> 9302 </span>
<span class="lnr"> 9303 </span><span class="Comment">             // we're done with this property</span>
<span class="lnr"> 9304 </span>             <span class="Statement">return</span>;
<span class="lnr"> 9305 </span>          }
<span class="lnr"> 9306 </span>       }
<span class="lnr"> 9307 </span>    });
<span class="lnr"> 9308 </span>}
<span class="lnr"> 9309 </span>
<span class="lnr"> 9310 </span><span class="Identifier">function</span> Animation( elem, properties, options ) {
<span class="lnr"> 9311 </span>    <span class="Type">var</span> result,
<span class="lnr"> 9312 </span>       index = <span class="Constant">0</span>,
<span class="lnr"> 9313 </span>       tweenerIndex = <span class="Constant">0</span>,
<span class="lnr"> 9314 </span>       length = animationPrefilters.length,
<span class="lnr"> 9315 </span>       deferred = jQuery.Deferred().always( <span class="Identifier">function</span>() {
<span class="lnr"> 9316 </span><span class="Comment">          // don't match elem in the :animated selector</span>
<span class="lnr"> 9317 </span>          <span class="Statement">delete</span> tick.elem;
<span class="lnr"> 9318 </span>       }),
<span class="lnr"> 9319 </span>       tick = <span class="Identifier">function</span>() {
<span class="lnr"> 9320 </span>          <span class="Type">var</span> currentTime = fxNow || createFxNow(),
<span class="lnr"> 9321 </span>             remaining = <span class="Special">Math</span>.max( <span class="Constant">0</span>, animation.startTime + animation.duration - currentTime ),
<span class="lnr"> 9322 </span>             percent = <span class="Constant">1</span> - ( remaining / animation.duration || <span class="Constant">0</span> ),
<span class="lnr"> 9323 </span>             index = <span class="Constant">0</span>,
<span class="lnr"> 9324 </span>             length = animation.tweens.length;
<span class="lnr"> 9325 </span>
<span class="lnr"> 9326 </span>          <span class="Statement">for</span> ( ; index &lt; length ; index++ ) {
<span class="lnr"> 9327 </span>             animation.tweens[ index ].run( percent );
<span class="lnr"> 9328 </span>          }
<span class="lnr"> 9329 </span>
<span class="lnr"> 9330 </span>          deferred.notifyWith( elem, [ animation, percent, remaining ]);
<span class="lnr"> 9331 </span>
<span class="lnr"> 9332 </span>          <span class="Statement">if</span> ( percent &lt; <span class="Constant">1</span> &amp;&amp; length ) {
<span class="lnr"> 9333 </span>             <span class="Statement">return</span> remaining;
<span class="lnr"> 9334 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 9335 </span>             deferred.resolveWith( elem, [ animation ] );
<span class="lnr"> 9336 </span>             <span class="Statement">return</span> <span class="Constant">false</span>;
<span class="lnr"> 9337 </span>          }
<span class="lnr"> 9338 </span>       },
<span class="lnr"> 9339 </span>       animation = deferred.promise({
<span class="lnr"> 9340 </span>          <span class="Statement">elem</span>: elem,
<span class="lnr"> 9341 </span>          <span class="Statement">props</span>: jQuery.extend( {}, properties ),
<span class="lnr"> 9342 </span>          <span class="Statement">opts</span>: jQuery.extend( <span class="Constant">true</span>, { <span class="Statement">specialEasing</span>: {} }, options ),
<span class="lnr"> 9343 </span>          <span class="Statement">originalProperties</span>: properties,
<span class="lnr"> 9344 </span>          <span class="Statement">originalOptions</span>: options,
<span class="lnr"> 9345 </span>          <span class="Statement">startTime</span>: fxNow || createFxNow(),
<span class="lnr"> 9346 </span>          <span class="Statement">duration</span>: options.duration,
<span class="lnr"> 9347 </span>          <span class="Statement">tweens</span>: [],
<span class="lnr"> 9348 </span>          <span class="Statement">createTween</span>: <span class="Identifier">function</span>( prop, end, easing ) {
<span class="lnr"> 9349 </span>             <span class="Type">var</span> tween = jQuery.Tween( elem, animation.opts, prop, end,
<span class="lnr"> 9350 </span>                   animation.opts.specialEasing[ prop ] || animation.opts.easing );
<span class="lnr"> 9351 </span>             animation.tweens.push( tween );
<span class="lnr"> 9352 </span>             <span class="Statement">return</span> tween;
<span class="lnr"> 9353 </span>          },
<span class="lnr"> 9354 </span>          <span class="Statement">stop</span>: <span class="Identifier">function</span>( gotoEnd ) {
<span class="lnr"> 9355 </span>             <span class="Type">var</span> index = <span class="Constant">0</span>,
<span class="lnr"> 9356 </span><span class="Comment">                // if we are going to the end, we want to run all the tweens</span>
<span class="lnr"> 9357 </span><span class="Comment">                // otherwise we skip this part</span>
<span class="lnr"> 9358 </span>                length = gotoEnd ? animation.tweens.<span class="Statement">length</span> : <span class="Constant">0</span>;
<span class="lnr"> 9359 </span>
<span class="lnr"> 9360 </span>             <span class="Statement">for</span> ( ; index &lt; length ; index++ ) {
<span class="lnr"> 9361 </span>                animation.tweens[ index ].run( <span class="Constant">1</span> );
<span class="lnr"> 9362 </span>             }
<span class="lnr"> 9363 </span>
<span class="lnr"> 9364 </span><span class="Comment">             // resolve when we played the last frame</span>
<span class="lnr"> 9365 </span><span class="Comment">             // otherwise, reject</span>
<span class="lnr"> 9366 </span>             <span class="Statement">if</span> ( gotoEnd ) {
<span class="lnr"> 9367 </span>                deferred.resolveWith( elem, [ animation, gotoEnd ] );
<span class="lnr"> 9368 </span>             } <span class="Statement">else</span> {
<span class="lnr"> 9369 </span>                deferred.rejectWith( elem, [ animation, gotoEnd ] );
<span class="lnr"> 9370 </span>             }
<span class="lnr"> 9371 </span>             <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 9372 </span>          }
<span class="lnr"> 9373 </span>       }),
<span class="lnr"> 9374 </span>       props = animation.props;
<span class="lnr"> 9375 </span>
<span class="lnr"> 9376 </span>    propFilter( props, animation.opts.specialEasing );
<span class="lnr"> 9377 </span>
<span class="lnr"> 9378 </span>    <span class="Statement">for</span> ( ; index &lt; length ; index++ ) {
<span class="lnr"> 9379 </span>       result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
<span class="lnr"> 9380 </span>       <span class="Statement">if</span> ( result ) {
<span class="lnr"> 9381 </span>          <span class="Statement">return</span> result;
<span class="lnr"> 9382 </span>       }
<span class="lnr"> 9383 </span>    }
<span class="lnr"> 9384 </span>
<span class="lnr"> 9385 </span>    createTweens( animation, props );
<span class="lnr"> 9386 </span>
<span class="lnr"> 9387 </span>    <span class="Statement">if</span> ( jQuery.isFunction( animation.opts.start ) ) {
<span class="lnr"> 9388 </span>       animation.opts.start.call( elem, animation );
<span class="lnr"> 9389 </span>    }
<span class="lnr"> 9390 </span>
<span class="lnr"> 9391 </span>    jQuery.fx.timer(
<span class="lnr"> 9392 </span>       jQuery.extend( tick, {
<span class="lnr"> 9393 </span>          <span class="Statement">anim</span>: animation,
<span class="lnr"> 9394 </span>          <span class="Statement">queue</span>: animation.opts.queue,
<span class="lnr"> 9395 </span>          <span class="Statement">elem</span>: elem
<span class="lnr"> 9396 </span>       })
<span class="lnr"> 9397 </span>    );
<span class="lnr"> 9398 </span>
<span class="lnr"> 9399 </span><span class="Comment">    // attach callbacks from options</span>
<span class="lnr"> 9400 </span>    <span class="Statement">return</span> animation.progress( animation.opts.progress )
<span class="lnr"> 9401 </span>       .done( animation.opts.done, animation.opts.complete )
<span class="lnr"> 9402 </span>       .fail( animation.opts.fail )
<span class="lnr"> 9403 </span>       .always( animation.opts.always );
<span class="lnr"> 9404 </span>}
<span class="lnr"> 9405 </span>
<span class="lnr"> 9406 </span><span class="Identifier">function</span> propFilter( props, specialEasing ) {
<span class="lnr"> 9407 </span>    <span class="Type">var</span> index, name, easing, value, hooks;
<span class="lnr"> 9408 </span>
<span class="lnr"> 9409 </span><span class="Comment">    // camelCase, specialEasing and expand cssHook pass</span>
<span class="lnr"> 9410 </span>    <span class="Statement">for</span> ( index <span class="Statement">in</span> props ) {
<span class="lnr"> 9411 </span>       name = jQuery.camelCase( index );
<span class="lnr"> 9412 </span>       easing = specialEasing[ name ];
<span class="lnr"> 9413 </span>       value = props[ index ];
<span class="lnr"> 9414 </span>       <span class="Statement">if</span> ( jQuery.isArray( value ) ) {
<span class="lnr"> 9415 </span>          easing = value[ <span class="Constant">1</span> ];
<span class="lnr"> 9416 </span>          value = props[ index ] = value[ <span class="Constant">0</span> ];
<span class="lnr"> 9417 </span>       }
<span class="lnr"> 9418 </span>
<span class="lnr"> 9419 </span>       <span class="Statement">if</span> ( index !== name ) {
<span class="lnr"> 9420 </span>          props[ name ] = value;
<span class="lnr"> 9421 </span>          <span class="Statement">delete</span> props[ index ];
<span class="lnr"> 9422 </span>       }
<span class="lnr"> 9423 </span>
<span class="lnr"> 9424 </span>       hooks = jQuery.cssHooks[ name ];
<span class="lnr"> 9425 </span>       <span class="Statement">if</span> ( hooks &amp;&amp; <span class="Constant">&quot;expand&quot;</span> <span class="Statement">in</span> hooks ) {
<span class="lnr"> 9426 </span>          value = hooks.expand( value );
<span class="lnr"> 9427 </span>          <span class="Statement">delete</span> props[ name ];
<span class="lnr"> 9428 </span>
<span class="lnr"> 9429 </span><span class="Comment">          // not quite $.extend, this wont overwrite keys already present.</span>
<span class="lnr"> 9430 </span><span class="Comment">          // also - reusing 'index' from above because we have the correct &quot;name&quot;</span>
<span class="lnr"> 9431 </span>          <span class="Statement">for</span> ( index <span class="Statement">in</span> value ) {
<span class="lnr"> 9432 </span>             <span class="Statement">if</span> ( !( index <span class="Statement">in</span> props ) ) {
<span class="lnr"> 9433 </span>                props[ index ] = value[ index ];
<span class="lnr"> 9434 </span>                specialEasing[ index ] = easing;
<span class="lnr"> 9435 </span>             }
<span class="lnr"> 9436 </span>          }
<span class="lnr"> 9437 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 9438 </span>          specialEasing[ name ] = easing;
<span class="lnr"> 9439 </span>       }
<span class="lnr"> 9440 </span>    }
<span class="lnr"> 9441 </span>}
<span class="lnr"> 9442 </span>
<span class="lnr"> 9443 </span>jQuery.Animation = jQuery.extend( Animation, {
<span class="lnr"> 9444 </span>
<span class="lnr"> 9445 </span>    <span class="Statement">tweener</span>: <span class="Identifier">function</span>( props, callback ) {
<span class="lnr"> 9446 </span>       <span class="Statement">if</span> ( jQuery.isFunction( props ) ) {
<span class="lnr"> 9447 </span>          callback = props;
<span class="lnr"> 9448 </span>          props = [ <span class="Constant">&quot;*&quot;</span> ];
<span class="lnr"> 9449 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 9450 </span>          props = props.split(<span class="Constant">&quot; &quot;</span>);
<span class="lnr"> 9451 </span>       }
<span class="lnr"> 9452 </span>
<span class="lnr"> 9453 </span>       <span class="Type">var</span> prop,
<span class="lnr"> 9454 </span>          index = <span class="Constant">0</span>,
<span class="lnr"> 9455 </span>          length = props.length;
<span class="lnr"> 9456 </span>
<span class="lnr"> 9457 </span>       <span class="Statement">for</span> ( ; index &lt; length ; index++ ) {
<span class="lnr"> 9458 </span>          prop = props[ index ];
<span class="lnr"> 9459 </span>          tweeners[ prop ] = tweeners[ prop ] || [];
<span class="lnr"> 9460 </span>          tweeners[ prop ].unshift( callback );
<span class="lnr"> 9461 </span>       }
<span class="lnr"> 9462 </span>    },
<span class="lnr"> 9463 </span>
<span class="lnr"> 9464 </span>    <span class="Statement">prefilter</span>: <span class="Identifier">function</span>( callback, prepend ) {
<span class="lnr"> 9465 </span>       <span class="Statement">if</span> ( prepend ) {
<span class="lnr"> 9466 </span>          animationPrefilters.unshift( callback );
<span class="lnr"> 9467 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 9468 </span>          animationPrefilters.push( callback );
<span class="lnr"> 9469 </span>       }
<span class="lnr"> 9470 </span>    }
<span class="lnr"> 9471 </span>});
<span class="lnr"> 9472 </span>
<span class="lnr"> 9473 </span><span class="Identifier">function</span> defaultPrefilter( elem, props, opts ) {
<span class="lnr"> 9474 </span>    <span class="Type">var</span> index, prop, value, length, dataShow, tween, hooks, oldfire,
<span class="lnr"> 9475 </span>       anim = <span class="Type">this</span>,
<span class="lnr"> 9476 </span>       style = elem.style,
<span class="lnr"> 9477 </span>       orig = {},
<span class="lnr"> 9478 </span>       handled = [],
<span class="lnr"> 9479 </span>       hidden = elem.nodeType &amp;&amp; isHidden( elem );
<span class="lnr"> 9480 </span>
<span class="lnr"> 9481 </span><span class="Comment">    // handle queue: false promises</span>
<span class="lnr"> 9482 </span>    <span class="Statement">if</span> ( !opts.queue ) {
<span class="lnr"> 9483 </span>       hooks = jQuery._queueHooks( elem, <span class="Constant">&quot;fx&quot;</span> );
<span class="lnr"> 9484 </span>       <span class="Statement">if</span> ( hooks.unqueued == <span class="Type">null</span> ) {
<span class="lnr"> 9485 </span>          hooks.unqueued = <span class="Constant">0</span>;
<span class="lnr"> 9486 </span>          oldfire = hooks.empty.fire;
<span class="lnr"> 9487 </span>          hooks.empty.fire = <span class="Identifier">function</span>() {
<span class="lnr"> 9488 </span>             <span class="Statement">if</span> ( !hooks.unqueued ) {
<span class="lnr"> 9489 </span>                oldfire();
<span class="lnr"> 9490 </span>             }
<span class="lnr"> 9491 </span>          };
<span class="lnr"> 9492 </span>       }
<span class="lnr"> 9493 </span>       hooks.unqueued++;
<span class="lnr"> 9494 </span>
<span class="lnr"> 9495 </span>       anim.always(<span class="Identifier">function</span>() {
<span class="lnr"> 9496 </span><span class="Comment">          // doing this makes sure that the complete handler will be called</span>
<span class="lnr"> 9497 </span><span class="Comment">          // before this completes</span>
<span class="lnr"> 9498 </span>          anim.always(<span class="Identifier">function</span>() {
<span class="lnr"> 9499 </span>             hooks.unqueued--;
<span class="lnr"> 9500 </span>             <span class="Statement">if</span> ( !jQuery.queue( elem, <span class="Constant">&quot;fx&quot;</span> ).length ) {
<span class="lnr"> 9501 </span>                hooks.empty.fire();
<span class="lnr"> 9502 </span>             }
<span class="lnr"> 9503 </span>          });
<span class="lnr"> 9504 </span>       });
<span class="lnr"> 9505 </span>    }
<span class="lnr"> 9506 </span>
<span class="lnr"> 9507 </span><span class="Comment">    // height/width overflow pass</span>
<span class="lnr"> 9508 </span>    <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">1</span> &amp;&amp; ( <span class="Constant">&quot;height&quot;</span> <span class="Statement">in</span> props || <span class="Constant">&quot;width&quot;</span> <span class="Statement">in</span> props ) ) {
<span class="lnr"> 9509 </span><span class="Comment">       // Make sure that nothing sneaks out</span>
<span class="lnr"> 9510 </span><span class="Comment">       // Record all 3 overflow attributes because IE does not</span>
<span class="lnr"> 9511 </span><span class="Comment">       // change the overflow attribute when overflowX and</span>
<span class="lnr"> 9512 </span><span class="Comment">       // overflowY are set to the same value</span>
<span class="lnr"> 9513 </span>       opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
<span class="lnr"> 9514 </span>
<span class="lnr"> 9515 </span><span class="Comment">       // Set display property to inline-block for height/width</span>
<span class="lnr"> 9516 </span><span class="Comment">       // animations on inline elements that are having width/height animated</span>
<span class="lnr"> 9517 </span>       <span class="Statement">if</span> ( jQuery.css( elem, <span class="Constant">&quot;display&quot;</span> ) === <span class="Constant">&quot;inline&quot;</span> &amp;&amp;
<span class="lnr"> 9518 </span>             jQuery.css( elem, <span class="Constant">&quot;float&quot;</span> ) === <span class="Constant">&quot;none&quot;</span> ) {
<span class="lnr"> 9519 </span>
<span class="lnr"> 9520 </span><span class="Comment">          // inline-level elements accept inline-block;</span>
<span class="lnr"> 9521 </span><span class="Comment">          // block-level elements need to be inline with layout</span>
<span class="lnr"> 9522 </span>          <span class="Statement">if</span> ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === <span class="Constant">&quot;inline&quot;</span> ) {
<span class="lnr"> 9523 </span>             style.display = <span class="Constant">&quot;inline-block&quot;</span>;
<span class="lnr"> 9524 </span>
<span class="lnr"> 9525 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 9526 </span>             style.zoom = <span class="Constant">1</span>;
<span class="lnr"> 9527 </span>          }
<span class="lnr"> 9528 </span>       }
<span class="lnr"> 9529 </span>    }
<span class="lnr"> 9530 </span>
<span class="lnr"> 9531 </span>    <span class="Statement">if</span> ( opts.overflow ) {
<span class="lnr"> 9532 </span>       style.overflow = <span class="Constant">&quot;hidden&quot;</span>;
<span class="lnr"> 9533 </span>       <span class="Statement">if</span> ( !jQuery.support.shrinkWrapBlocks ) {
<span class="lnr"> 9534 </span>          anim.done(<span class="Identifier">function</span>() {
<span class="lnr"> 9535 </span>             style.overflow = opts.overflow[ <span class="Constant">0</span> ];
<span class="lnr"> 9536 </span>             style.overflowX = opts.overflow[ <span class="Constant">1</span> ];
<span class="lnr"> 9537 </span>             style.overflowY = opts.overflow[ <span class="Constant">2</span> ];
<span class="lnr"> 9538 </span>          });
<span class="lnr"> 9539 </span>       }
<span class="lnr"> 9540 </span>    }
<span class="lnr"> 9541 </span>
<span class="lnr"> 9542 </span>
<span class="lnr"> 9543 </span><span class="Comment">    // show/hide pass</span>
<span class="lnr"> 9544 </span>    <span class="Statement">for</span> ( index <span class="Statement">in</span> props ) {
<span class="lnr"> 9545 </span>       value = props[ index ];
<span class="lnr"> 9546 </span>       <span class="Statement">if</span> ( rfxtypes.exec( value ) ) {
<span class="lnr"> 9547 </span>          <span class="Statement">delete</span> props[ index ];
<span class="lnr"> 9548 </span>          <span class="Statement">if</span> ( value === ( hidden ? <span class="Constant">&quot;hide&quot;</span> : <span class="Constant">&quot;show&quot;</span> ) ) {
<span class="lnr"> 9549 </span>             <span class="Statement">continue</span>;
<span class="lnr"> 9550 </span>          }
<span class="lnr"> 9551 </span>          handled.push( index );
<span class="lnr"> 9552 </span>       }
<span class="lnr"> 9553 </span>    }
<span class="lnr"> 9554 </span>
<span class="lnr"> 9555 </span>    length = handled.length;
<span class="lnr"> 9556 </span>    <span class="Statement">if</span> ( length ) {
<span class="lnr"> 9557 </span>       dataShow = jQuery._data( elem, <span class="Constant">&quot;fxshow&quot;</span> ) || jQuery._data( elem, <span class="Constant">&quot;fxshow&quot;</span>, {} );
<span class="lnr"> 9558 </span>       <span class="Statement">if</span> ( hidden ) {
<span class="lnr"> 9559 </span>          jQuery( elem ).show();
<span class="lnr"> 9560 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 9561 </span>          anim.done(<span class="Identifier">function</span>() {
<span class="lnr"> 9562 </span>             jQuery( elem ).hide();
<span class="lnr"> 9563 </span>          });
<span class="lnr"> 9564 </span>       }
<span class="lnr"> 9565 </span>       anim.done(<span class="Identifier">function</span>() {
<span class="lnr"> 9566 </span>          <span class="Type">var</span> prop;
<span class="lnr"> 9567 </span>          jQuery.removeData( elem, <span class="Constant">&quot;fxshow&quot;</span>, <span class="Constant">true</span> );
<span class="lnr"> 9568 </span>          <span class="Statement">for</span> ( prop <span class="Statement">in</span> orig ) {
<span class="lnr"> 9569 </span>             jQuery.style( elem, prop, orig[ prop ] );
<span class="lnr"> 9570 </span>          }
<span class="lnr"> 9571 </span>       });
<span class="lnr"> 9572 </span>       <span class="Statement">for</span> ( index = <span class="Constant">0</span> ; index &lt; length ; index++ ) {
<span class="lnr"> 9573 </span>          prop = handled[ index ];
<span class="lnr"> 9574 </span>          tween = anim.createTween( prop, hidden ? dataShow[ prop ] : <span class="Constant">0</span> );
<span class="lnr"> 9575 </span>          orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
<span class="lnr"> 9576 </span>
<span class="lnr"> 9577 </span>          <span class="Statement">if</span> ( !( prop <span class="Statement">in</span> dataShow ) ) {
<span class="lnr"> 9578 </span>             dataShow[ prop ] = tween.start;
<span class="lnr"> 9579 </span>             <span class="Statement">if</span> ( hidden ) {
<span class="lnr"> 9580 </span>                tween.end = tween.start;
<span class="lnr"> 9581 </span>                tween.start = prop === <span class="Constant">&quot;width&quot;</span> || prop === <span class="Constant">&quot;height&quot;</span> ? <span class="Constant">1</span> : <span class="Constant">0</span>;
<span class="lnr"> 9582 </span>             }
<span class="lnr"> 9583 </span>          }
<span class="lnr"> 9584 </span>       }
<span class="lnr"> 9585 </span>    }
<span class="lnr"> 9586 </span>}
<span class="lnr"> 9587 </span>
<span class="lnr"> 9588 </span><span class="Identifier">function</span> Tween( elem, options, prop, end, easing ) {
<span class="lnr"> 9589 </span>    <span class="Statement">return</span> <span class="Statement">new</span> Tween.prototype.init( elem, options, prop, end, easing );
<span class="lnr"> 9590 </span>}
<span class="lnr"> 9591 </span>jQuery.Tween = Tween;
<span class="lnr"> 9592 </span>
<span class="lnr"> 9593 </span>Tween.<span class="Type">prototype</span> = {
<span class="lnr"> 9594 </span>    <span class="Statement">constructor</span>: Tween,
<span class="lnr"> 9595 </span>    <span class="Statement">init</span>: <span class="Identifier">function</span>( elem, options, prop, end, easing, unit ) {
<span class="lnr"> 9596 </span>       <span class="Type">this</span>.elem = elem;
<span class="lnr"> 9597 </span>       <span class="Type">this</span>.prop = prop;
<span class="lnr"> 9598 </span>       <span class="Type">this</span>.easing = easing || <span class="Constant">&quot;swing&quot;</span>;
<span class="lnr"> 9599 </span>       <span class="Type">this</span>.options = options;
<span class="lnr"> 9600 </span>       <span class="Type">this</span>.start = <span class="Type">this</span>.now = <span class="Type">this</span>.cur();
<span class="lnr"> 9601 </span>       <span class="Type">this</span>.end = end;
<span class="lnr"> 9602 </span>       <span class="Type">this</span>.unit = unit || ( jQuery.cssNumber[ prop ] ? <span class="Constant">&quot;&quot;</span> : <span class="Constant">&quot;px&quot;</span> );
<span class="lnr"> 9603 </span>    },
<span class="lnr"> 9604 </span>    <span class="Statement">cur</span>: <span class="Identifier">function</span>() {
<span class="lnr"> 9605 </span>       <span class="Type">var</span> hooks = Tween.propHooks[ <span class="Type">this</span>.prop ];
<span class="lnr"> 9606 </span>
<span class="lnr"> 9607 </span>       <span class="Statement">return</span> hooks &amp;&amp; hooks.get ?
<span class="lnr"> 9608 </span>          hooks.get( <span class="Type">this</span> ) :
<span class="lnr"> 9609 </span>          Tween.propHooks._default.get( <span class="Type">this</span> );
<span class="lnr"> 9610 </span>    },
<span class="lnr"> 9611 </span>    <span class="Statement">run</span>: <span class="Identifier">function</span>( percent ) {
<span class="lnr"> 9612 </span>       <span class="Type">var</span> eased,
<span class="lnr"> 9613 </span>          hooks = Tween.propHooks[ <span class="Type">this</span>.prop ];
<span class="lnr"> 9614 </span>
<span class="lnr"> 9615 </span>       <span class="Statement">if</span> ( <span class="Type">this</span>.options.duration ) {
<span class="lnr"> 9616 </span>          <span class="Type">this</span>.pos = eased = jQuery.easing[ <span class="Type">this</span>.easing ](
<span class="lnr"> 9617 </span>             percent, <span class="Type">this</span>.options.duration * percent, <span class="Constant">0</span>, <span class="Constant">1</span>, <span class="Type">this</span>.options.duration
<span class="lnr"> 9618 </span>          );
<span class="lnr"> 9619 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 9620 </span>          <span class="Type">this</span>.pos = eased = percent;
<span class="lnr"> 9621 </span>       }
<span class="lnr"> 9622 </span>       <span class="Type">this</span>.now = ( <span class="Type">this</span>.end - <span class="Type">this</span>.start ) * eased + <span class="Type">this</span>.start;
<span class="lnr"> 9623 </span>
<span class="lnr"> 9624 </span>       <span class="Statement">if</span> ( <span class="Type">this</span>.options.step ) {
<span class="lnr"> 9625 </span>          <span class="Type">this</span>.options.step.call( <span class="Type">this</span>.elem, <span class="Type">this</span>.now, <span class="Type">this</span> );
<span class="lnr"> 9626 </span>       }
<span class="lnr"> 9627 </span>
<span class="lnr"> 9628 </span>       <span class="Statement">if</span> ( hooks &amp;&amp; hooks.set ) {
<span class="lnr"> 9629 </span>          hooks.set( <span class="Type">this</span> );
<span class="lnr"> 9630 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 9631 </span>          Tween.propHooks._default.set( <span class="Type">this</span> );
<span class="lnr"> 9632 </span>       }
<span class="lnr"> 9633 </span>       <span class="Statement">return</span> <span class="Type">this</span>;
<span class="lnr"> 9634 </span>    }
<span class="lnr"> 9635 </span>};
<span class="lnr"> 9636 </span>
<span class="lnr"> 9637 </span>Tween.<span class="Type">prototype</span>.init.<span class="Type">prototype</span> = Tween.<span class="Type">prototype</span>;
<span class="lnr"> 9638 </span>
<span class="lnr"> 9639 </span>Tween.propHooks = {
<span class="lnr"> 9640 </span>    <span class="Statement">_default</span>: {
<span class="lnr"> 9641 </span>       <span class="Statement">get</span>: <span class="Identifier">function</span>( tween ) {
<span class="lnr"> 9642 </span>          <span class="Type">var</span> result;
<span class="lnr"> 9643 </span>
<span class="lnr"> 9644 </span>          <span class="Statement">if</span> ( tween.elem[ tween.prop ] != <span class="Type">null</span> &amp;&amp;
<span class="lnr"> 9645 </span>             (!tween.elem.style || tween.elem.style[ tween.prop ] == <span class="Type">null</span>) ) {
<span class="lnr"> 9646 </span>             <span class="Statement">return</span> tween.elem[ tween.prop ];
<span class="lnr"> 9647 </span>          }
<span class="lnr"> 9648 </span>
<span class="lnr"> 9649 </span><span class="Comment">          // passing any value as a 4th parameter to .css will automatically</span>
<span class="lnr"> 9650 </span><span class="Comment">          // attempt a parseFloat and fallback to a string if the parse fails</span>
<span class="lnr"> 9651 </span><span class="Comment">          // so, simple values such as &quot;10px&quot; are parsed to Float.</span>
<span class="lnr"> 9652 </span><span class="Comment">          // complex values such as &quot;rotate(1rad)&quot; are returned as is.</span>
<span class="lnr"> 9653 </span>          result = jQuery.css( tween.elem, tween.prop, <span class="Constant">false</span>, <span class="Constant">&quot;&quot;</span> );
<span class="lnr"> 9654 </span><span class="Comment">          // Empty strings, null, undefined and &quot;auto&quot; are converted to 0.</span>
<span class="lnr"> 9655 </span>          <span class="Statement">return</span> !result || result === <span class="Constant">&quot;auto&quot;</span> ? <span class="Constant">0</span> : result;
<span class="lnr"> 9656 </span>       },
<span class="lnr"> 9657 </span>       <span class="Statement">set</span>: <span class="Identifier">function</span>( tween ) {
<span class="lnr"> 9658 </span><span class="Comment">          // use step hook for back compat - use cssHook if its there - use .style if its</span>
<span class="lnr"> 9659 </span><span class="Comment">          // available and use plain properties where available</span>
<span class="lnr"> 9660 </span>          <span class="Statement">if</span> ( jQuery.fx.step[ tween.prop ] ) {
<span class="lnr"> 9661 </span>             jQuery.fx.step[ tween.prop ]( tween );
<span class="lnr"> 9662 </span>          } <span class="Statement">else</span> <span class="Statement">if</span> ( tween.elem.style &amp;&amp; ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != <span class="Type">null</span> || jQuery.cssHooks[ tween.prop ] ) ) {
<span class="lnr"> 9663 </span>             jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
<span class="lnr"> 9664 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 9665 </span>             tween.elem[ tween.prop ] = tween.now;
<span class="lnr"> 9666 </span>          }
<span class="lnr"> 9667 </span>       }
<span class="lnr"> 9668 </span>    }
<span class="lnr"> 9669 </span>};
<span class="lnr"> 9670 </span>
<span class="lnr"> 9671 </span><span class="Comment">// Remove in 2.0 - this supports IE8's panic based approach</span>
<span class="lnr"> 9672 </span><span class="Comment">// to setting things on disconnected nodes</span>
<span class="lnr"> 9673 </span>
<span class="lnr"> 9674 </span>Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
<span class="lnr"> 9675 </span>    <span class="Statement">set</span>: <span class="Identifier">function</span>( tween ) {
<span class="lnr"> 9676 </span>       <span class="Statement">if</span> ( tween.elem.nodeType &amp;&amp; tween.elem.parentNode ) {
<span class="lnr"> 9677 </span>          tween.elem[ tween.prop ] = tween.now;
<span class="lnr"> 9678 </span>       }
<span class="lnr"> 9679 </span>    }
<span class="lnr"> 9680 </span>};
<span class="lnr"> 9681 </span>
<span class="lnr"> 9682 </span>jQuery.each([ <span class="Constant">&quot;toggle&quot;</span>, <span class="Constant">&quot;show&quot;</span>, <span class="Constant">&quot;hide&quot;</span> ], <span class="Identifier">function</span>( i, name ) {
<span class="lnr"> 9683 </span>    <span class="Type">var</span> cssFn = jQuery.fn[ name ];
<span class="lnr"> 9684 </span>    jQuery.fn[ name ] = <span class="Identifier">function</span>( speed, easing, callback ) {
<span class="lnr"> 9685 </span>       <span class="Statement">return</span> speed == <span class="Type">null</span> || <span class="Statement">typeof</span> speed === <span class="Constant">&quot;boolean&quot;</span> ||
<span class="lnr"> 9686 </span><span class="Comment">          // special check for .toggle( handler, handler, ... )</span>
<span class="lnr"> 9687 </span>          ( !i &amp;&amp; jQuery.isFunction( speed ) &amp;&amp; jQuery.isFunction( easing ) ) ?
<span class="lnr"> 9688 </span>          cssFn.apply( <span class="Type">this</span>, arguments ) :
<span class="lnr"> 9689 </span>          <span class="Type">this</span>.animate( genFx( name, <span class="Constant">true</span> ), speed, easing, callback );
<span class="lnr"> 9690 </span>    };
<span class="lnr"> 9691 </span>});
<span class="lnr"> 9692 </span>
<span class="lnr"> 9693 </span>jQuery.fn.extend({
<span class="lnr"> 9694 </span>    <span class="Statement">fadeTo</span>: <span class="Identifier">function</span>( speed, to, easing, callback ) {
<span class="lnr"> 9695 </span>
<span class="lnr"> 9696 </span><span class="Comment">       // show any hidden elements after setting opacity to 0</span>
<span class="lnr"> 9697 </span>       <span class="Statement">return</span> <span class="Type">this</span>.filter( isHidden ).css( <span class="Constant">&quot;opacity&quot;</span>, <span class="Constant">0</span> ).show()
<span class="lnr"> 9698 </span>
<span class="lnr"> 9699 </span><span class="Comment">          // animate to the value specified</span>
<span class="lnr"> 9700 </span>          .end().animate({ <span class="Statement">opacity</span>: to }, speed, easing, callback );
<span class="lnr"> 9701 </span>    },
<span class="lnr"> 9702 </span>    <span class="Statement">animate</span>: <span class="Identifier">function</span>( prop, speed, easing, callback ) {
<span class="lnr"> 9703 </span>       <span class="Type">var</span> empty = jQuery.isEmptyObject( prop ),
<span class="lnr"> 9704 </span>          optall = jQuery.speed( speed, easing, callback ),
<span class="lnr"> 9705 </span>          doAnimation = <span class="Identifier">function</span>() {
<span class="lnr"> 9706 </span><span class="Comment">             // Operate on a copy of prop so per-property easing won't be lost</span>
<span class="lnr"> 9707 </span>             <span class="Type">var</span> anim = Animation( <span class="Type">this</span>, jQuery.extend( {}, prop ), optall );
<span class="lnr"> 9708 </span>
<span class="lnr"> 9709 </span><span class="Comment">             // Empty animations resolve immediately</span>
<span class="lnr"> 9710 </span>             <span class="Statement">if</span> ( empty ) {
<span class="lnr"> 9711 </span>                anim.stop( <span class="Constant">true</span> );
<span class="lnr"> 9712 </span>             }
<span class="lnr"> 9713 </span>          };
<span class="lnr"> 9714 </span>
<span class="lnr"> 9715 </span>       <span class="Statement">return</span> empty || optall.queue === <span class="Constant">false</span> ?
<span class="lnr"> 9716 </span>          <span class="Type">this</span>.each( doAnimation ) :
<span class="lnr"> 9717 </span>          <span class="Type">this</span>.queue( optall.queue, doAnimation );
<span class="lnr"> 9718 </span>    },
<span class="lnr"> 9719 </span>    <span class="Statement">stop</span>: <span class="Identifier">function</span>( type, clearQueue, gotoEnd ) {
<span class="lnr"> 9720 </span>       <span class="Type">var</span> stopQueue = <span class="Identifier">function</span>( hooks ) {
<span class="lnr"> 9721 </span>          <span class="Type">var</span> stop = hooks.stop;
<span class="lnr"> 9722 </span>          <span class="Statement">delete</span> hooks.stop;
<span class="lnr"> 9723 </span>          stop( gotoEnd );
<span class="lnr"> 9724 </span>       };
<span class="lnr"> 9725 </span>
<span class="lnr"> 9726 </span>       <span class="Statement">if</span> ( <span class="Statement">typeof</span> type !== <span class="Constant">&quot;string&quot;</span> ) {
<span class="lnr"> 9727 </span>          gotoEnd = clearQueue;
<span class="lnr"> 9728 </span>          clearQueue = type;
<span class="lnr"> 9729 </span>          type = <span class="Type">undefined</span>;
<span class="lnr"> 9730 </span>       }
<span class="lnr"> 9731 </span>       <span class="Statement">if</span> ( clearQueue &amp;&amp; type !== <span class="Constant">false</span> ) {
<span class="lnr"> 9732 </span>          <span class="Type">this</span>.queue( type || <span class="Constant">&quot;fx&quot;</span>, [] );
<span class="lnr"> 9733 </span>       }
<span class="lnr"> 9734 </span>
<span class="lnr"> 9735 </span>       <span class="Statement">return</span> <span class="Type">this</span>.each(<span class="Identifier">function</span>() {
<span class="lnr"> 9736 </span>          <span class="Type">var</span> dequeue = <span class="Constant">true</span>,
<span class="lnr"> 9737 </span>             index = type != <span class="Type">null</span> &amp;&amp; type + <span class="Constant">&quot;queueHooks&quot;</span>,
<span class="lnr"> 9738 </span>             timers = jQuery.timers,
<span class="lnr"> 9739 </span>             data = jQuery._data( <span class="Type">this</span> );
<span class="lnr"> 9740 </span>
<span class="lnr"> 9741 </span>          <span class="Statement">if</span> ( index ) {
<span class="lnr"> 9742 </span>             <span class="Statement">if</span> ( data[ index ] &amp;&amp; data[ index ].stop ) {
<span class="lnr"> 9743 </span>                stopQueue( data[ index ] );
<span class="lnr"> 9744 </span>             }
<span class="lnr"> 9745 </span>          } <span class="Statement">else</span> {
<span class="lnr"> 9746 </span>             <span class="Statement">for</span> ( index <span class="Statement">in</span> data ) {
<span class="lnr"> 9747 </span>                <span class="Statement">if</span> ( data[ index ] &amp;&amp; data[ index ].stop &amp;&amp; rrun.test( index ) ) {
<span class="lnr"> 9748 </span>                   stopQueue( data[ index ] );
<span class="lnr"> 9749 </span>                }
<span class="lnr"> 9750 </span>             }
<span class="lnr"> 9751 </span>          }
<span class="lnr"> 9752 </span>
<span class="lnr"> 9753 </span>          <span class="Statement">for</span> ( index = timers.length; index--; ) {
<span class="lnr"> 9754 </span>             <span class="Statement">if</span> ( timers[ index ].elem === <span class="Type">this</span> &amp;&amp; (type == <span class="Type">null</span> || timers[ index ].queue === type) ) {
<span class="lnr"> 9755 </span>                timers[ index ].anim.stop( gotoEnd );
<span class="lnr"> 9756 </span>                dequeue = <span class="Constant">false</span>;
<span class="lnr"> 9757 </span>                timers.splice( index, <span class="Constant">1</span> );
<span class="lnr"> 9758 </span>             }
<span class="lnr"> 9759 </span>          }
<span class="lnr"> 9760 </span>
<span class="lnr"> 9761 </span><span class="Comment">          // start the next in the queue if the last step wasn't forced</span>
<span class="lnr"> 9762 </span><span class="Comment">          // timers currently will call their complete callbacks, which will dequeue</span>
<span class="lnr"> 9763 </span><span class="Comment">          // but only if they were gotoEnd</span>
<span class="lnr"> 9764 </span>          <span class="Statement">if</span> ( dequeue || !gotoEnd ) {
<span class="lnr"> 9765 </span>             jQuery.dequeue( <span class="Type">this</span>, type );
<span class="lnr"> 9766 </span>          }
<span class="lnr"> 9767 </span>       });
<span class="lnr"> 9768 </span>    }
<span class="lnr"> 9769 </span>});
<span class="lnr"> 9770 </span>
<span class="lnr"> 9771 </span><span class="Comment">// Generate parameters to create a standard animation</span>
<span class="lnr"> 9772 </span><span class="Identifier">function</span> genFx( type, includeWidth ) {
<span class="lnr"> 9773 </span>    <span class="Type">var</span> which,
<span class="lnr"> 9774 </span>       attrs = { <span class="Statement">height</span>: type },
<span class="lnr"> 9775 </span>       i = <span class="Constant">0</span>;
<span class="lnr"> 9776 </span>
<span class="lnr"> 9777 </span><span class="Comment">    // if we include width, step value is 1 to do all cssExpand values,</span>
<span class="lnr"> 9778 </span><span class="Comment">    // if we don't include width, step value is 2 to skip over Left and Right</span>
<span class="lnr"> 9779 </span>    includeWidth = includeWidth? <span class="Constant">1</span> : <span class="Constant">0</span>;
<span class="lnr"> 9780 </span>    <span class="Statement">for</span>( ; i &lt; <span class="Constant">4</span> ; i += <span class="Constant">2</span> - includeWidth ) {
<span class="lnr"> 9781 </span>       which = cssExpand[ i ];
<span class="lnr"> 9782 </span>       attrs[ <span class="Constant">&quot;margin&quot;</span> + which ] = attrs[ <span class="Constant">&quot;padding&quot;</span> + which ] = type;
<span class="lnr"> 9783 </span>    }
<span class="lnr"> 9784 </span>
<span class="lnr"> 9785 </span>    <span class="Statement">if</span> ( includeWidth ) {
<span class="lnr"> 9786 </span>       attrs.opacity = attrs.width = type;
<span class="lnr"> 9787 </span>    }
<span class="lnr"> 9788 </span>
<span class="lnr"> 9789 </span>    <span class="Statement">return</span> attrs;
<span class="lnr"> 9790 </span>}
<span class="lnr"> 9791 </span>
<span class="lnr"> 9792 </span><span class="Comment">// Generate shortcuts for custom animations</span>
<span class="lnr"> 9793 </span>jQuery.each({
<span class="lnr"> 9794 </span>    <span class="Statement">slideDown</span>: genFx(<span class="Constant">&quot;show&quot;</span>),
<span class="lnr"> 9795 </span>    <span class="Statement">slideUp</span>: genFx(<span class="Constant">&quot;hide&quot;</span>),
<span class="lnr"> 9796 </span>    <span class="Statement">slideToggle</span>: genFx(<span class="Constant">&quot;toggle&quot;</span>),
<span class="lnr"> 9797 </span>    <span class="Statement">fadeIn</span>: { <span class="Statement">opacity</span>: <span class="Constant">&quot;show&quot;</span> },
<span class="lnr"> 9798 </span>    <span class="Statement">fadeOut</span>: { <span class="Statement">opacity</span>: <span class="Constant">&quot;hide&quot;</span> },
<span class="lnr"> 9799 </span>    <span class="Statement">fadeToggle</span>: { <span class="Statement">opacity</span>: <span class="Constant">&quot;toggle&quot;</span> }
<span class="lnr"> 9800 </span>}, <span class="Identifier">function</span>( name, props ) {
<span class="lnr"> 9801 </span>    jQuery.fn[ name ] = <span class="Identifier">function</span>( speed, easing, callback ) {
<span class="lnr"> 9802 </span>       <span class="Statement">return</span> <span class="Type">this</span>.animate( props, speed, easing, callback );
<span class="lnr"> 9803 </span>    };
<span class="lnr"> 9804 </span>});
<span class="lnr"> 9805 </span>
<span class="lnr"> 9806 </span>jQuery.speed = <span class="Identifier">function</span>( speed, easing, fn ) {
<span class="lnr"> 9807 </span>    <span class="Type">var</span> opt = speed &amp;&amp; <span class="Statement">typeof</span> speed === <span class="Constant">&quot;object&quot;</span> ? jQuery.extend( {}, speed ) : {
<span class="lnr"> 9808 </span>       <span class="Statement">complete</span>: fn || !fn &amp;&amp; easing ||
<span class="lnr"> 9809 </span>          jQuery.isFunction( speed ) &amp;&amp; speed,
<span class="lnr"> 9810 </span>       <span class="Statement">duration</span>: speed,
<span class="lnr"> 9811 </span>       <span class="Statement">easing</span>: fn &amp;&amp; easing || easing &amp;&amp; !jQuery.isFunction( easing ) &amp;&amp; easing
<span class="lnr"> 9812 </span>    };
<span class="lnr"> 9813 </span>
<span class="lnr"> 9814 </span>    opt.duration = jQuery.fx.off ? <span class="Constant">0</span> : <span class="Statement">typeof</span> opt.duration === <span class="Constant">&quot;number&quot;</span> ? opt.<span class="Statement">duration</span> :
<span class="lnr"> 9815 </span>       opt.duration <span class="Statement">in</span> jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
<span class="lnr"> 9816 </span>
<span class="lnr"> 9817 </span><span class="Comment">    // normalize opt.queue - true/undefined/null -&gt; &quot;fx&quot;</span>
<span class="lnr"> 9818 </span>    <span class="Statement">if</span> ( opt.queue == <span class="Type">null</span> || opt.queue === <span class="Constant">true</span> ) {
<span class="lnr"> 9819 </span>       opt.queue = <span class="Constant">&quot;fx&quot;</span>;
<span class="lnr"> 9820 </span>    }
<span class="lnr"> 9821 </span>
<span class="lnr"> 9822 </span><span class="Comment">    // Queueing</span>
<span class="lnr"> 9823 </span>    opt.old = opt.complete;
<span class="lnr"> 9824 </span>
<span class="lnr"> 9825 </span>    opt.complete = <span class="Identifier">function</span>() {
<span class="lnr"> 9826 </span>       <span class="Statement">if</span> ( jQuery.isFunction( opt.old ) ) {
<span class="lnr"> 9827 </span>          opt.old.call( <span class="Type">this</span> );
<span class="lnr"> 9828 </span>       }
<span class="lnr"> 9829 </span>
<span class="lnr"> 9830 </span>       <span class="Statement">if</span> ( opt.queue ) {
<span class="lnr"> 9831 </span>          jQuery.dequeue( <span class="Type">this</span>, opt.queue );
<span class="lnr"> 9832 </span>       }
<span class="lnr"> 9833 </span>    };
<span class="lnr"> 9834 </span>
<span class="lnr"> 9835 </span>    <span class="Statement">return</span> opt;
<span class="lnr"> 9836 </span>};
<span class="lnr"> 9837 </span>
<span class="lnr"> 9838 </span>jQuery.easing = {
<span class="lnr"> 9839 </span>    <span class="Statement">linear</span>: <span class="Identifier">function</span>( p ) {
<span class="lnr"> 9840 </span>       <span class="Statement">return</span> p;
<span class="lnr"> 9841 </span>    },
<span class="lnr"> 9842 </span>    <span class="Statement">swing</span>: <span class="Identifier">function</span>( p ) {
<span class="lnr"> 9843 </span>       <span class="Statement">return</span> <span class="Constant">0.5</span> - <span class="Special">Math</span>.cos( p*<span class="Special">Math</span>.PI ) / <span class="Constant">2</span>;
<span class="lnr"> 9844 </span>    }
<span class="lnr"> 9845 </span>};
<span class="lnr"> 9846 </span>
<span class="lnr"> 9847 </span>jQuery.timers = [];
<span class="lnr"> 9848 </span>jQuery.fx = Tween.<span class="Type">prototype</span>.init;
<span class="lnr"> 9849 </span>jQuery.fx.tick = <span class="Identifier">function</span>() {
<span class="lnr"> 9850 </span>    <span class="Type">var</span> timer,
<span class="lnr"> 9851 </span>       timers = jQuery.timers,
<span class="lnr"> 9852 </span>       i = <span class="Constant">0</span>;
<span class="lnr"> 9853 </span>
<span class="lnr"> 9854 </span>    <span class="Statement">for</span> ( ; i &lt; timers.length; i++ ) {
<span class="lnr"> 9855 </span>       timer = timers[ i ];
<span class="lnr"> 9856 </span><span class="Comment">       // Checks the timer has not already been removed</span>
<span class="lnr"> 9857 </span>       <span class="Statement">if</span> ( !timer() &amp;&amp; timers[ i ] === timer ) {
<span class="lnr"> 9858 </span>          timers.splice( i--, <span class="Constant">1</span> );
<span class="lnr"> 9859 </span>       }
<span class="lnr"> 9860 </span>    }
<span class="lnr"> 9861 </span>
<span class="lnr"> 9862 </span>    <span class="Statement">if</span> ( !timers.length ) {
<span class="lnr"> 9863 </span>       jQuery.fx.stop();
<span class="lnr"> 9864 </span>    }
<span class="lnr"> 9865 </span>};
<span class="lnr"> 9866 </span>
<span class="lnr"> 9867 </span>jQuery.fx.timer = <span class="Identifier">function</span>( timer ) {
<span class="lnr"> 9868 </span>    <span class="Statement">if</span> ( timer() &amp;&amp; jQuery.timers.push( timer ) &amp;&amp; !timerId ) {
<span class="lnr"> 9869 </span>       timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
<span class="lnr"> 9870 </span>    }
<span class="lnr"> 9871 </span>};
<span class="lnr"> 9872 </span>
<span class="lnr"> 9873 </span>jQuery.fx.interval = <span class="Constant">13</span>;
<span class="lnr"> 9874 </span>
<span class="lnr"> 9875 </span>jQuery.fx.stop = <span class="Identifier">function</span>() {
<span class="lnr"> 9876 </span>    clearInterval( timerId );
<span class="lnr"> 9877 </span>    timerId = <span class="Type">null</span>;
<span class="lnr"> 9878 </span>};
<span class="lnr"> 9879 </span>
<span class="lnr"> 9880 </span>jQuery.fx.speeds = {
<span class="lnr"> 9881 </span>    <span class="Statement">slow</span>: <span class="Constant">600</span>,
<span class="lnr"> 9882 </span>    <span class="Statement">fast</span>: <span class="Constant">200</span>,
<span class="lnr"> 9883 </span><span class="Comment">    // Default speed</span>
<span class="lnr"> 9884 </span>    <span class="Statement">_default</span>: <span class="Constant">400</span>
<span class="lnr"> 9885 </span>};
<span class="lnr"> 9886 </span>
<span class="lnr"> 9887 </span><span class="Comment">// Back Compat &lt;1.8 extension point</span>
<span class="lnr"> 9888 </span>jQuery.fx.step = {};
<span class="lnr"> 9889 </span>
<span class="lnr"> 9890 </span><span class="Statement">if</span> ( jQuery.expr &amp;&amp; jQuery.expr.filters ) {
<span class="lnr"> 9891 </span>    jQuery.expr.filters.animated = <span class="Identifier">function</span>( elem ) {
<span class="lnr"> 9892 </span>       <span class="Statement">return</span> jQuery.grep(jQuery.timers, <span class="Identifier">function</span>( fn ) {
<span class="lnr"> 9893 </span>          <span class="Statement">return</span> elem === fn.elem;
<span class="lnr"> 9894 </span>       }).length;
<span class="lnr"> 9895 </span>    };
<span class="lnr"> 9896 </span>}
<span class="lnr"> 9897 </span><span class="Type">var</span> rroot = <span class="Constant">/^(?:body|html)$/i</span>;
<span class="lnr"> 9898 </span>
<span class="lnr"> 9899 </span>jQuery.fn.offset = <span class="Identifier">function</span>( options ) {
<span class="lnr"> 9900 </span>    <span class="Statement">if</span> ( arguments.length ) {
<span class="lnr"> 9901 </span>       <span class="Statement">return</span> options === <span class="Type">undefined</span> ?
<span class="lnr"> 9902 </span>          <span class="Type">this</span> :
<span class="lnr"> 9903 </span>          <span class="Type">this</span>.each(<span class="Identifier">function</span>( i ) {
<span class="lnr"> 9904 </span>             jQuery.offset.setOffset( <span class="Type">this</span>, options, i );
<span class="lnr"> 9905 </span>          });
<span class="lnr"> 9906 </span>    }
<span class="lnr"> 9907 </span>
<span class="lnr"> 9908 </span>    <span class="Type">var</span> box, docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft, top, left,
<span class="lnr"> 9909 </span>       elem = <span class="Type">this</span>[ <span class="Constant">0</span> ],
<span class="lnr"> 9910 </span>       doc = elem &amp;&amp; elem.ownerDocument;
<span class="lnr"> 9911 </span>
<span class="lnr"> 9912 </span>    <span class="Statement">if</span> ( !doc ) {
<span class="lnr"> 9913 </span>       <span class="Statement">return</span>;
<span class="lnr"> 9914 </span>    }
<span class="lnr"> 9915 </span>
<span class="lnr"> 9916 </span>    <span class="Statement">if</span> ( (body = doc.body) === elem ) {
<span class="lnr"> 9917 </span>       <span class="Statement">return</span> jQuery.offset.bodyOffset( elem );
<span class="lnr"> 9918 </span>    }
<span class="lnr"> 9919 </span>
<span class="lnr"> 9920 </span>    docElem = doc.documentElement;
<span class="lnr"> 9921 </span>
<span class="lnr"> 9922 </span><span class="Comment">    // Make sure we're not dealing with a disconnected DOM node</span>
<span class="lnr"> 9923 </span>    <span class="Statement">if</span> ( !jQuery.contains( docElem, elem ) ) {
<span class="lnr"> 9924 </span>       <span class="Statement">return</span> { <span class="Statement">top</span>: <span class="Constant">0</span>, <span class="Statement">left</span>: <span class="Constant">0</span> };
<span class="lnr"> 9925 </span>    }
<span class="lnr"> 9926 </span>
<span class="lnr"> 9927 </span>    box = elem.getBoundingClientRect();
<span class="lnr"> 9928 </span>    win = getWindow( doc );
<span class="lnr"> 9929 </span>    clientTop  = docElem.clientTop  || body.clientTop  || <span class="Constant">0</span>;
<span class="lnr"> 9930 </span>    clientLeft = docElem.clientLeft || body.clientLeft || <span class="Constant">0</span>;
<span class="lnr"> 9931 </span>    scrollTop  = win.pageYOffset || docElem.scrollTop;
<span class="lnr"> 9932 </span>    scrollLeft = win.pageXOffset || docElem.scrollLeft;
<span class="lnr"> 9933 </span>    top  = box.top  + scrollTop  - clientTop;
<span class="lnr"> 9934 </span>    left = box.left + scrollLeft - clientLeft;
<span class="lnr"> 9935 </span>
<span class="lnr"> 9936 </span>    <span class="Statement">return</span> { <span class="Statement">top</span>: top, <span class="Statement">left</span>: left };
<span class="lnr"> 9937 </span>};
<span class="lnr"> 9938 </span>
<span class="lnr"> 9939 </span>jQuery.offset = {
<span class="lnr"> 9940 </span>
<span class="lnr"> 9941 </span>    <span class="Statement">bodyOffset</span>: <span class="Identifier">function</span>( body ) {
<span class="lnr"> 9942 </span>       <span class="Type">var</span> top = body.offsetTop,
<span class="lnr"> 9943 </span>          left = body.offsetLeft;
<span class="lnr"> 9944 </span>
<span class="lnr"> 9945 </span>       <span class="Statement">if</span> ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
<span class="lnr"> 9946 </span>          top  += parseFloat( jQuery.css(body, <span class="Constant">&quot;marginTop&quot;</span>) ) || <span class="Constant">0</span>;
<span class="lnr"> 9947 </span>          left += parseFloat( jQuery.css(body, <span class="Constant">&quot;marginLeft&quot;</span>) ) || <span class="Constant">0</span>;
<span class="lnr"> 9948 </span>       }
<span class="lnr"> 9949 </span>
<span class="lnr"> 9950 </span>       <span class="Statement">return</span> { <span class="Statement">top</span>: top, <span class="Statement">left</span>: left };
<span class="lnr"> 9951 </span>    },
<span class="lnr"> 9952 </span>
<span class="lnr"> 9953 </span>    <span class="Statement">setOffset</span>: <span class="Identifier">function</span>( elem, options, i ) {
<span class="lnr"> 9954 </span>       <span class="Type">var</span> position = jQuery.css( elem, <span class="Constant">&quot;position&quot;</span> );
<span class="lnr"> 9955 </span>
<span class="lnr"> 9956 </span><span class="Comment">       // set position first, in-case top/left are set even on static elem</span>
<span class="lnr"> 9957 </span>       <span class="Statement">if</span> ( position === <span class="Constant">&quot;static&quot;</span> ) {
<span class="lnr"> 9958 </span>          elem.style.position = <span class="Constant">&quot;relative&quot;</span>;
<span class="lnr"> 9959 </span>       }
<span class="lnr"> 9960 </span>
<span class="lnr"> 9961 </span>       <span class="Type">var</span> curElem = jQuery( elem ),
<span class="lnr"> 9962 </span>          curOffset = curElem.offset(),
<span class="lnr"> 9963 </span>          curCSSTop = jQuery.css( elem, <span class="Constant">&quot;top&quot;</span> ),
<span class="lnr"> 9964 </span>          curCSSLeft = jQuery.css( elem, <span class="Constant">&quot;left&quot;</span> ),
<span class="lnr"> 9965 </span>          calculatePosition = ( position === <span class="Constant">&quot;absolute&quot;</span> || position === <span class="Constant">&quot;fixed&quot;</span> ) &amp;&amp; jQuery.inArray(<span class="Constant">&quot;auto&quot;</span>, [curCSSTop, curCSSLeft]) &gt; -<span class="Constant">1</span>,
<span class="lnr"> 9966 </span>          props = {}, curPosition = {}, curTop, curLeft;
<span class="lnr"> 9967 </span>
<span class="lnr"> 9968 </span><span class="Comment">       // need to be able to calculate position if either top or left is auto and position is either absolute or fixed</span>
<span class="lnr"> 9969 </span>       <span class="Statement">if</span> ( calculatePosition ) {
<span class="lnr"> 9970 </span>          curPosition = curElem.position();
<span class="lnr"> 9971 </span>          curTop = curPosition.top;
<span class="lnr"> 9972 </span>          curLeft = curPosition.left;
<span class="lnr"> 9973 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 9974 </span>          curTop = parseFloat( curCSSTop ) || <span class="Constant">0</span>;
<span class="lnr"> 9975 </span>          curLeft = parseFloat( curCSSLeft ) || <span class="Constant">0</span>;
<span class="lnr"> 9976 </span>       }
<span class="lnr"> 9977 </span>
<span class="lnr"> 9978 </span>       <span class="Statement">if</span> ( jQuery.isFunction( options ) ) {
<span class="lnr"> 9979 </span>          options = options.call( elem, i, curOffset );
<span class="lnr"> 9980 </span>       }
<span class="lnr"> 9981 </span>
<span class="lnr"> 9982 </span>       <span class="Statement">if</span> ( options.top != <span class="Type">null</span> ) {
<span class="lnr"> 9983 </span>          props.top = ( options.top - curOffset.top ) + curTop;
<span class="lnr"> 9984 </span>       }
<span class="lnr"> 9985 </span>       <span class="Statement">if</span> ( options.left != <span class="Type">null</span> ) {
<span class="lnr"> 9986 </span>          props.left = ( options.left - curOffset.left ) + curLeft;
<span class="lnr"> 9987 </span>       }
<span class="lnr"> 9988 </span>
<span class="lnr"> 9989 </span>       <span class="Statement">if</span> ( <span class="Constant">&quot;using&quot;</span> <span class="Statement">in</span> options ) {
<span class="lnr"> 9990 </span>          options.using.call( elem, props );
<span class="lnr"> 9991 </span>       } <span class="Statement">else</span> {
<span class="lnr"> 9992 </span>          curElem.css( props );
<span class="lnr"> 9993 </span>       }
<span class="lnr"> 9994 </span>    }
<span class="lnr"> 9995 </span>};
<span class="lnr"> 9996 </span>
<span class="lnr"> 9997 </span>
<span class="lnr"> 9998 </span>jQuery.fn.extend({
<span class="lnr"> 9999 </span>
<span class="lnr">10000 </span>    <span class="Statement">position</span>: <span class="Identifier">function</span>() {
<span class="lnr">10001 </span>       <span class="Statement">if</span> ( !<span class="Type">this</span>[<span class="Constant">0</span>] ) {
<span class="lnr">10002 </span>          <span class="Statement">return</span>;
<span class="lnr">10003 </span>       }
<span class="lnr">10004 </span>
<span class="lnr">10005 </span>       <span class="Type">var</span> elem = <span class="Type">this</span>[<span class="Constant">0</span>],
<span class="lnr">10006 </span>
<span class="lnr">10007 </span><span class="Comment">       // Get *real* offsetParent</span>
<span class="lnr">10008 </span>       offsetParent = <span class="Type">this</span>.offsetParent(),
<span class="lnr">10009 </span>
<span class="lnr">10010 </span><span class="Comment">       // Get correct offsets</span>
<span class="lnr">10011 </span>       offset       = <span class="Type">this</span>.offset(),
<span class="lnr">10012 </span>       parentOffset = rroot.test(offsetParent[<span class="Constant">0</span>].nodeName) ? { <span class="Statement">top</span>: <span class="Constant">0</span>, <span class="Statement">left</span>: <span class="Constant">0</span> } : offsetParent.offset();
<span class="lnr">10013 </span>
<span class="lnr">10014 </span><span class="Comment">       // Subtract element margins</span>
<span class="lnr">10015 </span><span class="Comment">       // note: when an element has margin: auto the offsetLeft and marginLeft</span>
<span class="lnr">10016 </span><span class="Comment">       // are the same in Safari causing offset.left to incorrectly be 0</span>
<span class="lnr">10017 </span>       offset.top  -= parseFloat( jQuery.css(elem, <span class="Constant">&quot;marginTop&quot;</span>) ) || <span class="Constant">0</span>;
<span class="lnr">10018 </span>       offset.left -= parseFloat( jQuery.css(elem, <span class="Constant">&quot;marginLeft&quot;</span>) ) || <span class="Constant">0</span>;
<span class="lnr">10019 </span>
<span class="lnr">10020 </span><span class="Comment">       // Add offsetParent borders</span>
<span class="lnr">10021 </span>       parentOffset.top  += parseFloat( jQuery.css(offsetParent[<span class="Constant">0</span>], <span class="Constant">&quot;borderTopWidth&quot;</span>) ) || <span class="Constant">0</span>;
<span class="lnr">10022 </span>       parentOffset.left += parseFloat( jQuery.css(offsetParent[<span class="Constant">0</span>], <span class="Constant">&quot;borderLeftWidth&quot;</span>) ) || <span class="Constant">0</span>;
<span class="lnr">10023 </span>
<span class="lnr">10024 </span><span class="Comment">       // Subtract the two offsets</span>
<span class="lnr">10025 </span>       <span class="Statement">return</span> {
<span class="lnr">10026 </span>          <span class="Statement">top</span>:  offset.top  - parentOffset.top,
<span class="lnr">10027 </span>          <span class="Statement">left</span>: offset.left - parentOffset.left
<span class="lnr">10028 </span>       };
<span class="lnr">10029 </span>    },
<span class="lnr">10030 </span>
<span class="lnr">10031 </span>    <span class="Statement">offsetParent</span>: <span class="Identifier">function</span>() {
<span class="lnr">10032 </span>       <span class="Statement">return</span> <span class="Type">this</span>.map(<span class="Identifier">function</span>() {
<span class="lnr">10033 </span>          <span class="Type">var</span> offsetParent = <span class="Type">this</span>.offsetParent || document.body;
<span class="lnr">10034 </span>          <span class="Statement">while</span> ( offsetParent &amp;&amp; (!rroot.test(offsetParent.nodeName) &amp;&amp; jQuery.css(offsetParent, <span class="Constant">&quot;position&quot;</span>) === <span class="Constant">&quot;static&quot;</span>) ) {
<span class="lnr">10035 </span>             offsetParent = offsetParent.offsetParent;
<span class="lnr">10036 </span>          }
<span class="lnr">10037 </span>          <span class="Statement">return</span> offsetParent || document.body;
<span class="lnr">10038 </span>       });
<span class="lnr">10039 </span>    }
<span class="lnr">10040 </span>});
<span class="lnr">10041 </span>
<span class="lnr">10042 </span>
<span class="lnr">10043 </span><span class="Comment">// Create scrollLeft and scrollTop methods</span>
<span class="lnr">10044 </span>jQuery.each( {<span class="Statement">scrollLeft</span>: <span class="Constant">&quot;pageXOffset&quot;</span>, <span class="Statement">scrollTop</span>: <span class="Constant">&quot;pageYOffset&quot;</span>}, <span class="Identifier">function</span>( method, prop ) {
<span class="lnr">10045 </span>    <span class="Type">var</span> top = <span class="Constant">/Y/</span>.test( prop );
<span class="lnr">10046 </span>
<span class="lnr">10047 </span>    jQuery.fn[ method ] = <span class="Identifier">function</span>( val ) {
<span class="lnr">10048 </span>       <span class="Statement">return</span> jQuery.access( <span class="Type">this</span>, <span class="Identifier">function</span>( elem, method, val ) {
<span class="lnr">10049 </span>          <span class="Type">var</span> win = getWindow( elem );
<span class="lnr">10050 </span>
<span class="lnr">10051 </span>          <span class="Statement">if</span> ( val === <span class="Type">undefined</span> ) {
<span class="lnr">10052 </span>             <span class="Statement">return</span> win ? (prop <span class="Statement">in</span> win) ? win[ prop ] :
<span class="lnr">10053 </span>                win.document.documentElement[ method ] :
<span class="lnr">10054 </span>                elem[ method ];
<span class="lnr">10055 </span>          }
<span class="lnr">10056 </span>
<span class="lnr">10057 </span>          <span class="Statement">if</span> ( win ) {
<span class="lnr">10058 </span>             win.scrollTo(
<span class="lnr">10059 </span>                !top ? val : jQuery( win ).scrollLeft(),
<span class="lnr">10060 </span>                 top ? val : jQuery( win ).scrollTop()
<span class="lnr">10061 </span>             );
<span class="lnr">10062 </span>
<span class="lnr">10063 </span>          } <span class="Statement">else</span> {
<span class="lnr">10064 </span>             elem[ method ] = val;
<span class="lnr">10065 </span>          }
<span class="lnr">10066 </span>       }, method, val, arguments.length, <span class="Type">null</span> );
<span class="lnr">10067 </span>    };
<span class="lnr">10068 </span>});
<span class="lnr">10069 </span>
<span class="lnr">10070 </span><span class="Identifier">function</span> getWindow( elem ) {
<span class="lnr">10071 </span>    <span class="Statement">return</span> jQuery.isWindow( elem ) ?
<span class="lnr">10072 </span>       <span class="Statement">elem</span> :
<span class="lnr">10073 </span>       elem.nodeType === <span class="Constant">9</span> ?
<span class="lnr">10074 </span>          elem.defaultView || elem.<span class="Statement">parentWindow</span> :
<span class="lnr">10075 </span>          <span class="Constant">false</span>;
<span class="lnr">10076 </span>}
<span class="lnr">10077 </span><span class="Comment">// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods</span>
<span class="lnr">10078 </span>jQuery.each( { <span class="Statement">Height</span>: <span class="Constant">&quot;height&quot;</span>, <span class="Statement">Width</span>: <span class="Constant">&quot;width&quot;</span> }, <span class="Identifier">function</span>( name, type ) {
<span class="lnr">10079 </span>    jQuery.each( { <span class="Statement">padding</span>: <span class="Constant">&quot;inner&quot;</span> + name, <span class="Statement">content</span>: type, <span class="Constant">&quot;&quot;</span>: <span class="Constant">&quot;outer&quot;</span> + name }, <span class="Identifier">function</span>( defaultExtra, funcName ) {
<span class="lnr">10080 </span><span class="Comment">       // margin is only for outerHeight, outerWidth</span>
<span class="lnr">10081 </span>       jQuery.fn[ funcName ] = <span class="Identifier">function</span>( margin, value ) {
<span class="lnr">10082 </span>          <span class="Type">var</span> chainable = arguments.length &amp;&amp; ( defaultExtra || <span class="Statement">typeof</span> margin !== <span class="Constant">&quot;boolean&quot;</span> ),
<span class="lnr">10083 </span>             extra = defaultExtra || ( margin === <span class="Constant">true</span> || value === <span class="Constant">true</span> ? <span class="Constant">&quot;margin&quot;</span> : <span class="Constant">&quot;border&quot;</span> );
<span class="lnr">10084 </span>
<span class="lnr">10085 </span>          <span class="Statement">return</span> jQuery.access( <span class="Type">this</span>, <span class="Identifier">function</span>( elem, type, value ) {
<span class="lnr">10086 </span>             <span class="Type">var</span> doc;
<span class="lnr">10087 </span>
<span class="lnr">10088 </span>             <span class="Statement">if</span> ( jQuery.isWindow( elem ) ) {
<span class="lnr">10089 </span><span class="Comment">                // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there</span>
<span class="lnr">10090 </span><span class="Comment">                // isn't a whole lot we can do. See pull request at this URL for discussion:</span>
<span class="lnr">10091 </span><span class="Comment">                // <a href="https://github.com/jquery/jquery/pull/764">https://github.com/jquery/jquery/pull/764</a></span>
<span class="lnr">10092 </span>                <span class="Statement">return</span> elem.document.documentElement[ <span class="Constant">&quot;client&quot;</span> + name ];
<span class="lnr">10093 </span>             }
<span class="lnr">10094 </span>
<span class="lnr">10095 </span><span class="Comment">             // Get document width or height</span>
<span class="lnr">10096 </span>             <span class="Statement">if</span> ( elem.nodeType === <span class="Constant">9</span> ) {
<span class="lnr">10097 </span>                doc = elem.documentElement;
<span class="lnr">10098 </span>
<span class="lnr">10099 </span><span class="Comment">                // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest</span>
<span class="lnr">10100 </span><span class="Comment">                // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.</span>
<span class="lnr">10101 </span>                <span class="Statement">return</span> <span class="Special">Math</span>.max(
<span class="lnr">10102 </span>                   elem.body[ <span class="Constant">&quot;scroll&quot;</span> + name ], doc[ <span class="Constant">&quot;scroll&quot;</span> + name ],
<span class="lnr">10103 </span>                   elem.body[ <span class="Constant">&quot;offset&quot;</span> + name ], doc[ <span class="Constant">&quot;offset&quot;</span> + name ],
<span class="lnr">10104 </span>                   doc[ <span class="Constant">&quot;client&quot;</span> + name ]
<span class="lnr">10105 </span>                );
<span class="lnr">10106 </span>             }
<span class="lnr">10107 </span>
<span class="lnr">10108 </span>             <span class="Statement">return</span> value === <span class="Type">undefined</span> ?
<span class="lnr">10109 </span><span class="Comment">                // Get width or height on the element, requesting but not forcing parseFloat</span>
<span class="lnr">10110 </span>                jQuery.css( elem, type, value, extra ) :
<span class="lnr">10111 </span>
<span class="lnr">10112 </span><span class="Comment">                // Set width or height on the element</span>
<span class="lnr">10113 </span>                jQuery.style( elem, type, value, extra );
<span class="lnr">10114 </span>          }, type, chainable ? margin : <span class="Type">undefined</span>, chainable, <span class="Type">null</span> );
<span class="lnr">10115 </span>       };
<span class="lnr">10116 </span>    });
<span class="lnr">10117 </span>});
<span class="lnr">10118 </span><span class="Comment">// Expose jQuery to the global object</span>
<span class="lnr">10119 </span>window.jQuery = window.$ = jQuery;
<span class="lnr">10120 </span>
<span class="lnr">10121 </span><span class="Comment">// Expose jQuery as an AMD module, but only for AMD loaders that</span>
<span class="lnr">10122 </span><span class="Comment">// understand the issues with loading multiple versions of jQuery</span>
<span class="lnr">10123 </span><span class="Comment">// in a page that all might call define(). The loader will indicate</span>
<span class="lnr">10124 </span><span class="Comment">// they have special allowances for multiple jQuery versions by</span>
<span class="lnr">10125 </span><span class="Comment">// specifying define.amd.jQuery = true. Register as a named module,</span>
<span class="lnr">10126 </span><span class="Comment">// since jQuery can be concatenated with other files that may use define,</span>
<span class="lnr">10127 </span><span class="Comment">// but not use a proper concatenation script that understands anonymous</span>
<span class="lnr">10128 </span><span class="Comment">// AMD modules. A named AMD is safest and most robust way to register.</span>
<span class="lnr">10129 </span><span class="Comment">// Lowercase jquery is used because AMD module names are derived from</span>
<span class="lnr">10130 </span><span class="Comment">// file names, and jQuery is normally delivered in a lowercase file name.</span>
<span class="lnr">10131 </span><span class="Comment">// Do this after creating the global so that if an AMD module wants to call</span>
<span class="lnr">10132 </span><span class="Comment">// noConflict to hide this version of jQuery, it will work.</span>
<span class="lnr">10133 </span><span class="Statement">if</span> ( <span class="Statement">typeof</span> define === <span class="Constant">&quot;function&quot;</span> &amp;&amp; define.amd &amp;&amp; define.amd.jQuery ) {
<span class="lnr">10134 </span>    define( <span class="Constant">&quot;jquery&quot;</span>, [], <span class="Identifier">function</span> () { <span class="Statement">return</span> jQuery; } );
<span class="lnr">10135 </span>}
<span class="lnr">10136 </span>
<span class="lnr">10137 </span><span class="Error">})</span>( window );
</pre>
</body>
</html>
